Data conversion library for .NET I created this project to simplify data conversion for a project I’m working on. You can take code that looks like this int output = 0; if(!int.TryParse(“123”), out output) { throw new Exception(“Couldn’t parse it”); } and instead just say int output = “123”.ToInt(); This assumes you don’t care it if parses and if […]

[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = “{0:dd.MM.yyyy}”)] displays date as intended, but on save it’s converted wrong.

As the topic says: [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = “{0:dd.MM.yyyy}”)] public DateTime? KeyStartDate { get; set; } That works great displaying it: <div class=”form-group”> <label asp-for=”KeyStartDate”>@Resources.Global.StartDate</label> <input data-toggle=”datepicker” asp-for=”KeyStartDate” class=”form-control” /> <span asp-validation-for=”KeyStartDate” class=”text-danger”></span> </div> ​ but when I submit the form the date is parsed wrong e.g. “MM/dd/YYYY”. So if I choose the date […]