Good afternoon,I am trying to connect my API to the app builder and when I do I seeI can link my get apis, and these are working as expected but the post requests I have are all greyed out.
Below is the post method within my asp.net api
[HttpPost("addIngredient")] public async Task<ActionResult<Guid>> addIngredient([FromBody] NewIngredient ingredient){ var newId = new OutputParameter<Guid?>(); var allergenId = new OutputParameter<Guid?>(); var nutrientId = new OutputParameter<Guid?>(); Guid libraryId = new Guid("CDDF26FE-D224-4916-8060-33F62E48F95E"); Guid groupId = new Guid("7993BFEE-E676-4A9A-A476-026953FB1594"); if (ingredient == null) { return BadRequest(); } else { await _foodDataServicesContext.GetProcedures().usp_InsertOrUpdateIngredientAsync(null,libraryId, groupId, ingredient.foodCode, ingredient.displayName, ingredient.displayName, "Description", 0, 0, 0, 0, 0, ingredient.costPerKilo, ingredient.internalReference, newId); foreach (AllergenIngredient allergen in ingredient.allergens) { await _foodDataServicesContext.GetProcedures().usp_Allergen_Ingredient_Link_InsertAsync(new Guid(allergen.AllergenId), newId._value, allergenId); } foreach (NutrientIngredientValue nutrientValue in ingredient.nutrients) { await _foodDataServicesContext.GetProcedures().usp_Nutrient_Ingredient_Values_InsertAsync(new Guid(nutrientValue.NutrientId), newId._value, nutrientValue.NutrientValue, nutrientId); } return Ok(newId._value); }
Thnaks
Hi Jake,
App Builder currently expects the full entity to be returned by the endpoint.Any chance that you can refactor to return the Ingredient instead of only the GUID?
Regards,Pablo