public async Task <int> CreateAsync(NotificationTypeCrtVM notificationTypeCrtVM) { var notificationTypeEntity = Mapper.Map(notificationTypeCrtVM, notificationType); var result = await notificationTypeRepository.AddAsync(notificationTypeEntity); return(result); }
public async Task <NotificationType> AddNotificationType(NotificationType entity) { NotificationType request = new NotificationType() { Code = entity.Code, ObjectType = entity.ObjectType, ContentTemplate = entity.ContentTemplate }; await notificationTypeRepository.AddAsync(request); return(request); }
public async Task <NotificationTypeResponse> SaveAsync(NotificationType nt) { try { await _notificationTypeRepository.AddAsync(nt); await _unitOfWork.CompleteAsync(); return(new NotificationTypeResponse(nt)); } catch (Exception ex) { return(new NotificationTypeResponse($"An error ocurred while saving the notification type: {ex.Message}")); } }