public void Create_WithValidData_SavesRecordInTheDatabase() { // Arrange var newFoodItem = sut.Create(foodItem); // Assert Assert.IsNotNull(newFoodItem); Assert.IsTrue(newFoodItem.FoodId != null); // CleanUp sut.Delete(foodItem.FoodId); }
public async Task <IHttpActionResult> Delete(int Id) { try{ log.Info(new MDCSet(this.ControllerContext.RouteData), new InfoException(Id)); await _entityRepo.Delete(Id); return(Ok("Registro eliminado exitosamente!")); } catch (Exception e) { log.Error(new MDCSet(this.ControllerContext.RouteData), e); return(InternalServerError(e)); } }
public void Delete(int id) { productRepository.Delete(id); }