Compare commits
No commits in common. "f38333dc8c420ef7053da0b2797dd94f61e848c4" and "59af36b3f20f30467e6a7d7deb7fc3ce37df62b2" have entirely different histories.
f38333dc8c
...
59af36b3f2
@ -40,19 +40,7 @@ namespace API.BusinessLogic
|
||||
|
||||
if (recipe == null || recipe.Id == 0) { return new ConflictObjectResult(new { message = "Could not find any recipe" }); }
|
||||
|
||||
var singleRecipeDTO = new GetSingleRecipeDTO();
|
||||
singleRecipeDTO.Id = recipe.Id;
|
||||
singleRecipeDTO.Name = recipe.Name;
|
||||
singleRecipeDTO.Description = recipe.Description;
|
||||
singleRecipeDTO.Ingredients = recipe.Ingredients;
|
||||
singleRecipeDTO.Directions = new List<string>();
|
||||
foreach (var item in recipe.Directions)
|
||||
{
|
||||
string directions = item.Instruktions;
|
||||
singleRecipeDTO.Directions.Add(directions);
|
||||
}
|
||||
|
||||
return new OkObjectResult(singleRecipeDTO);
|
||||
return new OkObjectResult(recipe);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1,16 +0,0 @@
|
||||
namespace API.Models.RecipeModels
|
||||
{
|
||||
public class GetSingleRecipeDTO
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
public List<string> Directions { get; set; }
|
||||
|
||||
public List<Ingredient> Ingredients { get; set; }
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user