public static ValidationResult FooIDUnique(Foo foo, ValidationContext context) { bool check = false; using (FooEntities fe = new FooEntities()) { check = fe.Foo.Any(f => f.FooId == foo.fooId); } if (!check) { return(ValidationResult.Success); } return(new ValidationResult("FooID error msg,", new string[] { "FooID" })); }
public TagService(FooEntities entity) { _entity = entity; }
public MyAppController() { Db = new FooEntities(); }
public ExpenseService(FooEntities entity) { _entity = entity; }