예제 #1
0
        public async Task <BaseEntity> SaveAndReturnEntityAsync(UserApplicationRoleDto entityDto)
        {
            var entity = _mapper.Map <UserApplicationRole>(entityDto);
            var result = await _repository.SaveAndReturnEntityAsync(entity);

            return(result);
        }
예제 #2
0
        public async Task <IActionResult> Put(int id, [FromBody] UserApplicationRoleDto userApplicationRole)
        {
            if (id == 0 || userApplicationRole.Id == 0)
            {
                return(StatusCode(StatusCodes.Status400BadRequest, "Id needs to be greater than 0."));
            }

            return(await SaveAndReturnEntityAsync(async() => await _userApplicationRoleService.SaveAndReturnEntityAsync(userApplicationRole)));
        }
예제 #3
0
        public async Task <IActionResult> Post([FromBody] UserApplicationRoleDto userApplicationRole)
        {
            if (userApplicationRole.Id != 0)
            {
                return(StatusCode(StatusCodes.Status400BadRequest, "Identity insert is not permitted."));
            }

            return(await SaveAndReturnEntityAsync(async() => await _userApplicationRoleService.SaveAndReturnEntityAsync(userApplicationRole)));
        }
예제 #4
0
        public async Task <int> SaveAsync(UserApplicationRoleDto entityDto)
        {
            var result = await SaveAndReturnEntityAsync(entityDto);

            return(result.Id);
        }
예제 #5
0
 public async Task<UserApplicationRoleDto> PutUserApplicationRole(int id,UserApplicationRoleDto model)
 {
     var url = CRMApiUri + "/UserApplicationRole/"+ id;
     var result = await PutRequestToApi(url, model);
     return result;
 }
예제 #6
0
 public async Task<UserApplicationRoleDto> PostUserApplicationRole(UserApplicationRoleDto model)
 {
     var url = CRMApiUri + "/UserApplicationRole";
     var result = await PostRequestToApi(url, model);
     return result;
 }
예제 #7
0
 public async Task <UserApplicationRoleDto> PutUserApplicationRole(int id, UserApplicationRoleDto model)
 {
     return(await _userApplicationRoleApiClient.PutUserApplicationRole(id, model));
 }
예제 #8
0
 public async Task <UserApplicationRoleDto> PostUserApplicationRole(UserApplicationRoleDto model)
 {
     return(await _userApplicationRoleApiClient.PostUserApplicationRole(model));
 }