This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Microsoft Visual Studio Solution File, Format Version 12.00 | |
# Visual Studio 2012 | |
Global | |
GlobalSection(SolutionProperties) = preSolution | |
HideSolutionNode = FALSE | |
EndGlobalSection | |
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Scripts to remove data you don't need here | |
*/ | |
/* | |
* Now let's clean that DB up! | |
*/ | |
DECLARE @DBName VarChar(25) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SomeClass { | |
public void SomeMethod() { | |
this.Log().Info(() => "Here is a log message with params which can be in Razor Views as well: '{0}'".FormatWith(typeof(SomeClass).Name)); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function controllaPIVA(pi) | |
{ | |
if( pi == '' ) return ''; | |
if( pi.length != 11 ) | |
return "La lunghezza della partita IVA non è\n" + | |
"corretta: la partita IVA dovrebbe essere lunga\n" + | |
"esattamente 11 caratteri.\n"; | |
validi = "0123456789"; | |
for( i = 0; i < 11; i++ ){ | |
if( validi.indexOf( pi.charAt(i) ) == -1 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function controllaCF(cf) | |
{ | |
var validi, i, s, set1, set2, setpari, setdisp; | |
if( cf == '' ) return ''; | |
cf = cf.toUpperCase(); | |
if( cf.length != 16 ) | |
return "La lunghezza del codice fiscale non è\n" | |
+"corretta: il codice fiscale dovrebbe essere lungo\n" | |
+"esattamente 16 caratteri.\n"; | |
validi = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void RegisterRoutes(RouteCollection routes) | |
{ | |
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); | |
// GET /api/{resource}/{action} | |
routes.MapHttpRoute( | |
name: "Web API RPC", | |
routeTemplate: "api/{controller}/{action}", | |
defaults: new { }, | |
constraints: new { action = @"[A-Za-z]+", httpMethod = new HttpMethodConstraint("GET") } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
SETLOCAL | |
SET VERSION=%1 | |
SET NUGET=buildsupport\nuget.exe | |
FOR %%G IN (packaging\nuget\*.nuspec) DO ( | |
%NUGET% pack %%G -Version %VERSION% -Symbols -o artifacts | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StatusCodesController: ApiController | |
{ | |
public HttpResponseMessage Get() | |
{ | |
var type = typeof (HttpStatusCode); | |
var values = | |
Enum.GetValues(type) | |
.Cast<HttpStatusCode>() | |
.Select(v => new {name = Enum.GetName(type, v), value = v}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<string> times = new List<string>(); | |
Enumerable.Range(0, 24).ToList() | |
.ForEach(hour => Enumerable.Range(0, 2).ToList() | |
.Select(x => string.Format("{0}:{1:00}", hour, x * 30)) | |
.ToList() | |
.ForEach(timeslot=>times.Add(timeslot))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override int SaveChanges() | |
{ | |
try | |
{ | |
return base.SaveChanges(); | |
} | |
catch (DbEntityValidationException ex) | |
{ | |
// Retrieve the error messages as a list of strings. | |
var errorMessages = ex.EntityValidationErrors |