This file contains hidden or 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 Student | |
{ | |
// Notice the nullable types | |
public int? PhysicsScore { get; set; } | |
public float? MathScore { get; set; } | |
public char? PhysicsGrade { get; set; } | |
public char? MathGrade { get;set; } | |
public string Name { get;set; } |
This file contains hidden or 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
<input data-val="true" id="Name" name="Name" type="text" value=""> | |
<input data-val="true" data-val-number="The field PhysicsScore must be a number." data-val-required="The PhysicsScore field is required." id="PhysicsScore" name="PhysicsScore" type="text" value=""> | |
<input data-val="true" data-val-number="The field MathScore must be a number." data-val-required="The MathScore field is required." id="MathScore" name="MathScore" type="text" value=""> | |
.... |
This file contains hidden or 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
@Html.TextBoxFor(student => student.Name) | |
@Html.TextBoxFor(student => student.PhysicsScore) | |
@Html.TextBoxFor(student => student.MathScore) | |
@Html.TextBoxFor(student => student.PhysicsGrade) | |
@Html.TextBoxFor(student => student.MathGrade) |
This file contains hidden or 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 Student | |
{ | |
public int PhysicsScore { get; set; } | |
public float MathScore { get; set; } | |
public char PhysicsGrade { get; set; } | |
public char MathGrade { get;set; } | |
public string Name { get;set; } | |
} |
This file contains hidden or 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
library(Rook) | |
# to install Rook, which makes it possible to run R as a server, | |
# R -q -e "install.packages('Rook', repos='http://cran.r-project.org')" | |
app <- function(env){ | |
req <- Rook::Request$new(env) | |
res <- Rook::Response$new() | |
res$write(42) | |
res$finish() |
This file contains hidden or 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
protected internal virtual ViewResult View(string viewName, string masterName, object model) { | |
if (model != null) { | |
ViewData.Model = model; | |
} | |
return new ViewResult { | |
ViewName = viewName, | |
MasterName = masterName, | |
ViewData = ViewData, | |
TempData = TempData |
This file contains hidden or 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 dynamic ViewBag { | |
get{ | |
if (_dynamicViewDataDictionary == null) { | |
_dynamicViewDataDictionary = new DynamicViewDataDictionary(() => ViewData); | |
} | |
return _dynamicViewDataDictionary; | |
} | |
} |
This file contains hidden or 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
//output : | |
Normal Array Elapsed Time: 10831 | |
Parallel For Elapsed Time: 39028 | |
Clone Elapsed Time: 2149 | |
//code | |
[Test] | |
public void zz() | |
{ |
This file contains hidden or 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 RecreateDatabaseWithSeedData : DropCreateDatabaseIfModelChanges<Jeevan.Database.JeevanDBContext> | |
{ | |
protected override void Seed(JeevanDBContext context) | |
{ | |
context.CordBloodUnits.Add(new CordBloodUnit() { HLA_A1 = 2, HLA_A2 = 24, HLA_B1 = 18, HLA_B2 = 40, HLA_C1 = 12, HLA_C2 = 15, DRB_1 = 11, DRB_2 = 14, DQB_1 = 03, DQB_2 = 05 }); | |
context.CordBloodUnits.Add(new CordBloodUnit(){HLA_A1=1, HLA_A2=32, HLA_B1=15, HLA_B2= 57, HLA_C1 = 6 , HLA_C2 = 07, DRB_1 = 15, DRB_2 = 16 , DQB_1 = 05, DQB_2 = 05}); | |
context.CordBloodUnits.Add(new CordBloodUnit(){HLA_A1=24, HLA_A2=33, HLA_B1=40, HLA_B2= 44, HLA_C1 = 1 , HLA_C2 = 07, DRB_1 = 01, DRB_2 = 07 , DQB_1 = 02, DQB_2 = 05}); | |
context.CordBloodUnits.Add(new CordBloodUnit(){HLA_A1=1, HLA_A2=33, HLA_B1=15, HLA_B2= 44, HLA_C1 = 3 , HLA_C2 = 07, DRB_1 = 07, DRB_2 = 13 , DQB_1 = 02, DQB_2 = 06}); | |
context.CordBloodUnits.Add(new CordBloodUnit(){HLA_A1=3, HLA_A2=68, HLA_B1=15, HLA_B2= 55, HLA |
This file contains hidden or 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
protected void Application_Start() | |
{ | |
System.Data.Entity.Database.SetInitializer(new CreateDatabaseIfNotExists<JeevanDBContext>()); | |
//new LogEvent("Completed db Setup"); | |
AreaRegistration.RegisterAllAreas(); | |
RegisterGlobalFilters(GlobalFilters.Filters); | |
RegisterRoutes(RouteTable.Routes); | |
BundleTable.Bundles.RegisterTemplateBundles(); |