public async Task <T> FindProductByIdAsync(int id)
 {
     using (var dbContext = new TheStoreContext())
     {
         return(await dbContext.FindAsync <T>(id));
     }
 }
Example #2
0
 public async Task <User> FindUserByIdAsync(int id)
 {
     using (var dbContext = new TheStoreContext())
     {
         return(await dbContext.FindAsync <User>(id));
     }
 }