예제 #1
0
        public async Task Add(PermissionGroup permissionGroup, Guid _UserId)
        {
            repository.AddAndReturnObject <PermissionGroup>(ref permissionGroup);
            await repository.SaveChangesAsync();

            await loggingService.LogActionData <PermissionGroup>(LoggingCategory.PermissionGroup, LoggingAction.Create,
                                                                 permissionGroup, null, _UserId, permissionGroup.Code.ToString());
        }
예제 #2
0
        public async Task Add(Admin admin, Guid _UserId)
        {
            //if (IsEmailUsedForAnotherAccount(admin.Email))
            //{
            //    throw new Exception(ExceptionsTypes.EmailExists.ToString());
            //}

            repository.AddAndReturnObject <Admin>(ref admin);
            await repository.SaveChangesAsync();

            await loggingService.LogActionData <Admin>(LoggingCategory.Administrator, LoggingAction.Create,
                                                       admin, null, _UserId, admin.Id.ToString());
        }