public async Task<ActionResult> Delete([FromBody] UserParamBO model)
        {
            await _userParamService
                .DeleteAsync(model);

            return Accepted();
        }
Example #2
0
        public async Task <UserParamBO> AddAsync(UserParamBO model)
        {
            var result = await this._userParamCommands
                         .AddAsync(MapModelToEntity(model));

            return(result != null?MapEntityToModel(result) : null);
        }
        public async Task<ActionResult> Update([FromBody] UserParamBO model)
        {
            await _userParamService
                .UpdateAsync(model);

            return NoContent();
        }
        public async Task<ActionResult> AddDatabaseEnviroment([FromBody] UserParamBO model)
        {
            var userParam = await _userParamService
                .AddAsync(model);

            if (model != null) 
                return CreatedAtAction("Get", new { databaseEnvironmentId = userParam.DatabaseEnvironmentId }, userParam);

            return BadRequest();
        }
Example #5
0
        private UserParam MapModelToEntity(UserParamBO model)
        {
            UserParam entity = new UserParam
            {
                DatabaseEnvironmentId = model.DatabaseEnvironmentId,
                Id    = model.Id,
                Name  = model.Name,
                Value = model.Value
            };

            return(entity);
        }
Example #6
0
        private UserParamBO MapEntityToModel(UserParam entity)
        {
            UserParamBO model = new UserParamBO
            {
                DatabaseEnvironmentId = entity.DatabaseEnvironmentId,
                Id    = entity.Id,
                Name  = entity.Name,
                Value = entity.Value
            };

            return(model);
        }
Example #7
0
 public async Task UpdateAsync(UserParamBO model)
 {
     await this._userParamCommands.UpdateAsync(MapModelToEntity(model));
 }
Example #8
0
 public async Task DeleteAsync(UserParamBO model)
 {
     await this._userParamCommands.DeleteAsync(model.Id);
 }