public async Task<ActionResult> Delete([FromBody] UserParamBO model) { await _userParamService .DeleteAsync(model); return Accepted(); }
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(); }
private UserParam MapModelToEntity(UserParamBO model) { UserParam entity = new UserParam { DatabaseEnvironmentId = model.DatabaseEnvironmentId, Id = model.Id, Name = model.Name, Value = model.Value }; return(entity); }
private UserParamBO MapEntityToModel(UserParam entity) { UserParamBO model = new UserParamBO { DatabaseEnvironmentId = entity.DatabaseEnvironmentId, Id = entity.Id, Name = entity.Name, Value = entity.Value }; return(model); }
public async Task UpdateAsync(UserParamBO model) { await this._userParamCommands.UpdateAsync(MapModelToEntity(model)); }
public async Task DeleteAsync(UserParamBO model) { await this._userParamCommands.DeleteAsync(model.Id); }