public async Task <ActionResult <Notify> > Create(NotifyDataDTO notify) { var result = await this.Mediator.Send(new CreateNotifyCommand { Data = notify }); return(ResponseHelper.ResponseOutcome <Notify>(result, this)); }
public async Task <ActionResult> Update(int id, NotifyDataDTO notify) { var result = await this.Mediator.Send(new UpdateNotifyCommand { Id = id, Data = notify }); return(ResponseHelper.ResponseOutcome <Notify>(result, this)); }
public static Notify Map(this NotifyDataDTO dto) => (dto != null) ? new Notify { CustomerId = dto.CustomerId ?? dto.CustomerId.Value, DateSent = DateTime.Now, Email = dto.Email, Retry = dto.Retry ?? dto.Retry.Value, Sent = dto.Sent ?? dto.Sent.Value, } : null;