Example #1
0
 public async Task <TEntity> GetAsync(int id)
 {
     try
     {
         return(await _repositoryFoodDbContext.Set <TEntity>().FindAsync(id));
     }
     catch (Exception)
     {
         throw new Exception("Couldn't retrieve entity");
     }
 }
 public void Create(T t)
 {
     db.Set <T>().Add(t);
 }