Exemple #1
0
        public virtual async Task <NotificationResult> DeleteByIdAsync(int id)
        {
            var result = new NotificationResult();

            result.Add(await _recipeRepository.DeleteByIdAsync(id));
            if (result.IsValid)
            {
                result.AddMessage(Shared.Domain.Resources.Handler.DeleteSuccess_Message);
            }
            else
            {
                result.AddErrorOnTop(Shared.Domain.Resources.Handler.DeleteError_Message);
            }
            return(result);
        }
Exemple #2
0
        public async Task <IActionResult> DeleteRecipe(string id)
        {
            await _repository.DeleteByIdAsync(id);

            return(Ok());
        }