Пример #1
0
        public BusinessResponse <bool> Delete(long id)
        {
            var result = _validator.Validate(new UnitGroupApiModel()
            {
                Id = id
            }, options => options.IncludeRuleSets(string.Join(",", Enum.GetName(typeof(UnitGroupRuleSet), UnitGroupRuleSet.Delete))));

            if (!result.IsValid || result.Errors.Any())
            {
                return(BusinessResponse <bool> .GenerateError(result));
            }

            return(BusinessResponse <bool>
                   .GenerateOk(_unitGroupDataAccess.Delete(id)));
        }