public async Task <GeneralRule> Edit(GeneralRule model)
        {
            var isUpdated = await _generalRuleRepository.Update(model);

            if (isUpdated)
            {
                return(await _generalRuleRepository.Read(model.Id));
            }

            throw new Exception($"Failed to update custom attribute rule {model.Id}");
        }
Example #2
0
        public async Task <bool> Update(DateTimeRule model)
        {
            var dto = model.ToDomainModel();

            if (model.GeneralRule != null)
            {
                await _generalRuleRepository.Update(model.GeneralRule);
            }

            _db.DateTimeRule.Update(dto);
            await _db.SaveChangesAsync();

            return(true);
        }
Example #3
0
        public async Task <bool> Update(SeverityRule model)
        {
            try
            {
                var dto = model.ToDomainModel();

                if (model.GeneralRule != null)
                {
                    await _generalRuleRepository.Update(model.GeneralRule);
                }

                _db.SeverityLevelRule.Update(dto);
                await _db.SaveChangesAsync();

                return(true);
            }
            catch
            {
                return(false);
            }
        }