public async Task <ResponseProperties> SetTypeInfractionAsync(TypeInfraction typeInfraction) { DynamicParameters parameters = new DynamicParameters(); parameters.Add("@description", typeInfraction.description, DbType.String, ParameterDirection.Input, 50); parameters.Add("@discount", typeInfraction.discount, DbType.Int32, ParameterDirection.Input); var result = await _dbConnection.QueryFirstAsync <ResponseProperties>("dbo.ISSP_InsertTypeInfraction", parameters, commandType : CommandType.StoredProcedure); return(result); }
public async Task <ActionResult <ResponseProperties> > SetTypeInfractionAsync([FromBody] TypeInfraction typeInfraction) { try { if (!ModelState.IsValid) { return(BadRequest()); } return(Ok(await _infraction.SetTypeInfractionAsync(typeInfraction))); } catch (Exception ex) { throw ex; } }