MCPcopy Create free account
hub / github.com/TryCatchLearn/Restore-v2 / ToDto

Method ToDto

API/Extensions/BasketExtensions.cs:10–28  ·  view source on GitHub ↗
(this Basket basket)

Source from the content-addressed store, hash-verified

8public static class BasketExtensions
9{
10 public static BasketDto ToDto(this Basket basket)
11 {
12 return new BasketDto
13 {
14 BasketId = basket.BasketId,
15 ClientSecret = basket.ClientSecret,
16 Coupon = basket.Coupon,
17 Items = basket.Items.Select(x => new BasketItemDto
18 {
19 ProductId = x.ProductId,
20 Name = x.Product.Name,
21 Price = x.Product.Price,
22 Brand = x.Product.Brand,
23 Type = x.Product.Type,
24 PictureUrl = x.Product.PictureUrl,
25 Quantity = x.Quantity
26 }).ToList()
27 };
28 }
29
30 public static async Task<Basket> GetBasketWithItems(this IQueryable<Basket> query,
31 string? basketId)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected