Ejemplo n.º 1
0
        public async Task <Permission> Delete(Permission Permission)
        {
            if (!await PermissionValidator.Delete(Permission))
            {
                return(Permission);
            }

            try
            {
                await UOW.PermissionRepository.Delete(Permission);

                return(Permission);
            }
            catch (Exception ex)
            {
                if (ex.InnerException == null)
                {
                    await Logging.CreateSystemLog(ex, nameof(PermissionService));

                    throw new MessageException(ex);
                }
                else
                {
                    await Logging.CreateSystemLog(ex.InnerException, nameof(PermissionService));

                    throw new MessageException(ex.InnerException);
                }
            }
        }