This is the first time I'm asking a question here, so please be tolerant :)
In an MVC web application powered up by knockout.js, I have, for clear example:
Simple ViewModel class in C#:
public class RetailCustomer { public DateTime BirthDate { get; set; } public string FirstName { get; set; } public string LastName { get; set; } }
Simple binding in knockout.js on MVC view:
function CustomerCtxViewModel() { var self = this; self.FirstName = ko.observable(''); self.LastName = ko.observable(''); self.BirthDate = ko.observable(''); $.getJSON("/api/RetailContext", function (data) { self.FirstName(data.FirstName); self.LastName(data.LastName); self.BirthDate(data.BirthDate); } }
Then I renamed the property BirthDate
in RetailCustomer
class to Birthdate
, because Code Analysis told me so... and the binding doesn't work anymore of course, and the worst thing is I find it out only during runtime.
QUESTION: Are there any tools, techniques that would warn me early enough, during compile time or automated builds maybe, so that I can see my mistake before the app is running?