You can validate a model object with EF 5 Code-First like that:
var validationResult = db.Entry(someModel).GetValidationResult();
But what if your model class is not mapped in your DbContext implementation and you’re planning to pass it directly to sproc via db.Database.ExecuteSqlCommand. How do you validate your model before passing it to sproc in this case?
1 Answer