コード例 #1
0
 public void Delete(int id)
 {
     try
     {
         bookService.Delete(id);
     }
     catch (Exception)
     {
         //Logar exceção
         handler.Notify(NotificationType.Error, Resources.Messages.FailedOperation);
     }
 }
コード例 #2
0
        bool IBaseValidator <T> .Validate(T dto)
        {
            var result = base.Validate(dto as T);

            result.Errors.ToList()
            .ForEach(c =>
            {
                notificationHandler.Notify(NotificationType.Error, c.ErrorMessage);
                dto.IsValid = false;
            });
            dto.IsValid = result.IsValid;
            return(result.IsValid);
        }