Exemple #1
0
        public async SystemTask UpdateAsync(NotificationTypeDto input)
        {
            using (var dbContext = _dbContextScopeFactory.Create())
            {
                var notificationType = await _notificationTypeRepository.FindAsync(p => p.Id == input.Id);

                notificationType.Update(
                    input.Name, input.Description, input.Template, input.ModuleCode, input.ActionType);
                dbContext.SaveChanges();
                await GetListAsync(true);
            }
        }
Exemple #2
0
        public async Task <NotificationTypeDto> AddAsync(NotificationTypeDto input)
        {
            using (var dbContext = _dbContextScopeFactory.Create())
            {
                var notificationType = NotificationType.Create(
                    input.Name, input.Description, input.Template, input.ModuleCode, input.ActionType);
                _notificationTypeRepository.Add(notificationType);
                dbContext.SaveChanges();
                await GetListAsync(true);

                return(_mapper.Map <NotificationTypeDto>(notificationType));
            }
        }