public DomainNotification(DomainNotificationType type, string property, string valor) { Tipo = type; Valor = valor; DataOcorrencia = DateTime.Now; PropertyName = property; }
public DomainNotification( string key, string value, DomainNotificationType type = DomainNotificationType.Conflict) { Key = key; Value = value; DomainNotificationType = type; }
public void NotificarException(DomainNotificationType notificationType, Exception exception) { DomainEvent.Raise(new DomainNotification(notificationType, exception.Message)); if (exception.InnerException != null) { DomainEvent.Raise(new DomainNotification(notificationType, exception.InnerException.Message)); } }
public DomainNotification(DomainHandlerType handlerType, DomainNotificationType domainNotificationType, string key, string value, Guid?entityPrimaryKey = null) { DomainNotificationId = Guid.NewGuid(); HandlerType = handlerType; DomainNotificationType = domainNotificationType; Version = 1; Key = key; Value = value; EntityPrimaryKey = entityPrimaryKey; }
private int GetStatusCodeByNotificationType(DomainNotificationType errorType) { return(errorType switch { //Conflict DomainNotificationType.UserAlreadyExists => 409, //Unprocessable Entity DomainNotificationType.UserInvalid => 422, //Not Found DomainNotificationType.UserNotFound => 404, (_) => 500, });
public DomainNotification(string message, DomainNotificationType type) { Message = message; Type = type; }
public DomainNotification(DomainNotificationType type, string value) { Type = type; Value = value; }
public DomainNotification(string title, string body, DomainNotificationType type) { Title = title; Body = body; Type = type; }
// 获取当前生命周期内的 DomainNotificationType 通知信息 public virtual List <DomainNotification> GetSpecifyTypeNotifications(DomainNotificationType domainNotificationType) { return(_ListNotification.Where(w => w.DomainNotificationType == domainNotificationType).ToList()); }
private void Notify(string message, DomainNotificationType type) => _notifications.Add(new DomainNotification(type, message));
public static DomainNotification Criar(DomainNotificationType type, string message) { return(new DomainNotification(type, message)); }