예제 #1
0
 public Store GetStoreByName(string name)
 {
     return(_db.Set <Store>().FirstOrDefault(s => s.Name == name));
 }
예제 #2
0
 public T GetAPizzaPartByName <T>(string name) where T : APizzaPart
 {
     return(_context.Set <T>().FirstOrDefault(part => part.Name == name));
 }
예제 #3
0
 public User GetUserByName(string name)
 {
     return(_context.Set <User>().ToList().FirstOrDefault(user => user.Name == name));
 }
예제 #4
0
 public TEntity Get(int id)
 {
     return(Context.Set <TEntity>().Find(id));
 }
예제 #5
0
 public void Add <T>(T item) where T : AEntity
 {
     _db.Set <T>().Add(item);
 }