public async Task <IHttpActionResult> AddTransport([FromBody] UpdateTransportRequest createRequest) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } await _transportRepositoryService.AddEntityAsync(createRequest); return(Ok()); }
public async Task <IHttpActionResult> UpdateTransport([FromUri] int id, [FromBody] UpdateTransportRequest updateRequest) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } await _transportRepositoryService.UpdateEntityAsync(updateRequest, id); return(Ok()); }
public bool Update(Transport el) { IRequest request = new UpdateTransportRequest(); try { using (var connection = new SqlConnection(connectionString)) { connection.Execute(request.Sql, el); } return(true); } catch (Exception e) { return(false); } }