Exemple #1
0
        public async Task <int> CreateAsync(NotificationTypeCrtVM notificationTypeCrtVM)
        {
            var notificationTypeEntity = Mapper.Map(notificationTypeCrtVM, notificationType);
            var result = await notificationTypeRepository.AddAsync(notificationTypeEntity);

            return(result);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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}"));
            }
        }