Example #1
0
 public async Task UpdateReview(Review reviewItem)
 {
     try
     {
         dbContext.Update(reviewItem);
         await dbContext.SaveChangesAsync();
     }
     catch (Exception)
     {
         throw new System.Exception($"Did not find review with id{reviewItem.id}");
     }
 }
Example #2
0
 public async Task UpdatePlace(Place place)
 {
     try
     {
         //Place toUpdate = await dbContext.Places.FirstAsync(p => p.id == place.id);
         dbContext.Update(place); //Love EF
         await dbContext.SaveChangesAsync();
     }
     catch (Exception e)
     {
         System.Console.WriteLine($"Did not find place with id{place.id}");
         throw new System.Exception(e.Message);
     }
 }