simple ajax controller (for countries etc) ajax (these are research notes) consuming WebApi with MVC consuming WebApi with MVC Dynamic content in MVC/Razor the following contains xml entries to get past razor runtime compilation errors of namespace not found: @Html.LabelFor(model => model.path.Value, “Path”) @Html.DropDownList(“Path”, new List { new SelectListItem { Text = TypeSafeEnum.a.Value, Value = TypeSafeEnum.a.Value }, new SelectListItem {… Read more →
Category: C#
Text enums with the Entity Framework / Code First in C#
One of the projects I am working on requires enumerated values be text and not numeric. maritalStatus = ‘Single’ instead of maritalStatus = 1 Below is an example. All of the code is generated using TextTemplates. The enums are referenced in the POCOs like so: [XmlElement(ElementName=”maritalStatus”)] public MaritalStatus maritalStatus { get; set; } //Enum values are flattened in the xml… Read more →
Execution List
A simple way to build up a list of methods that will all be called at a specific point I use this for 2 things: to schedule tests on the data to be run just before a commit to the database, e.g. to assess data integrity to make updates to repsonse data after a commit to the database, e.g. to… Read more →