public IActionResult Inserir(IngredienteLancheModel ingredienteLanche) { try { return(new Util().verificaStatus(_IIngredienteLanche.Inserir(ingredienteLanche))); } catch (Exception ex) { return(BadRequest(new Error(HttpStatusCode.InternalServerError, "IngredienteLanche.Inserir()", ex.Message))); } }
public string Inserir(IngredienteLancheModel ingredienteLanche) { try { DynamicParameters parameters = new DynamicParameters(); parameters.Add("@IDLANCHE", ingredienteLanche.idLanche, DbType.Int32, ParameterDirection.Input); parameters.Add("@IDINGREDIENTE", ingredienteLanche.idIngrediente, DbType.Int32, ParameterDirection.Input); return(Executar("SP_INGREDIENTELANCHE_INSERIR", parameters, CommandType.StoredProcedure)); } catch (Exception ex) { throw new Exception(ex.Message); } finally { Dispose(); } }