예제 #1
0
        /// <summary>
        /// Operation without transaction
        /// </summary>
        /// <param name="newPermissions"></param>
        /// <returns></returns>
        public IList <ValidationResult> SaveUserPermissions(IList <UserPermission> newPermissions)
        {
            IList <ValidationResult> validations = new List <ValidationResult>();

            foreach (var newPermission in newPermissions)
            {
                validations = _userPermissionRepository.Validate(newPermission);
                if (validations.Count > 0)
                {
                    return(validations);
                }

                _userPermissionRepository.Save(newPermission);
            }
            return(validations);
        }