public void Delete(Ingredient entity) { if (AuthorizedUsers["Delete"].SingleOrDefault(x => x == Role) != null) { IngredientController.Delete(entity); } }
private void OnDelete(IngredientEditDTO ingredientEditDTO, IngredientEditViewModel viewModel) { using (IIngredientController controller = factory.CreateIngredientController()) { ControllerMessage controllerMessage = controller.Delete(ingredientEditDTO.OldName); if (controllerMessage.IsSuccess) { Notify(); viewModel.Clear(); } else { MessageBox.Show(controllerMessage.Message); } } }