I find myself when using Entity Framework, before accessing any of Objects i have various try/catch methods, due to the amount of exceptions that “bubble” up. Now before i try and access my ObjectSet’s within my ObjectContext i usually make sure there are objects there to begin with. I usually do something like: […]Read more "[MVC 3] ObjectSet Extension Method–CountAll"
In the last post i described a way of using a static method to obtain which model field is causing your ModelState to be invalid. My good friend Shaw Young said that a Extension Method would be another way of doing this. And thinking of it, it makes more sense and a better and cleaner […]Read more "[MVC 3] ModelState ModelErrorCollection Debug–Extension Method"
UPDATE: Dan Kendall kindly done a gist of the code which can be found here if you need it which is related to this post: https://gist.github.com/3699804 We all use the ModelState.IsValid before we commit any changes to our Entity Framework ObjectContext to update our data source. But what is ModelState.IsValid? Well basically ModelState says… “Yes, all models […]Read more "[MVC 3] ModelState ModelErrorCollection Debug"