Untitled
unknown
plain_text
2 years ago
430 B
11
Indexable
app.MapGet("/api/products", (IMapper _mapper) => // Testing DTO's to with in memory "DB"
{
ApiResponse response = new ApiResponse();
response.Result = ProductStore.productlist
.Select(product => _mapper.Map<ProductDTO>(product)).ToList();
response.IsSucces = true;
response.StatusCode = System.Net.HttpStatusCode.OK;
return Results.Ok(response);
}).WithName("GetProducts").Produces(200);Editor is loading...