public async Task AddAsync(
            string userId,
            [FromBody] ApiBasketAddRequest request)
        {
            IUserActor actor = GetActor(userId);

            await actor.AddToBasket(request.ProductId, request.Quantity);
        }
Beispiel #2
0
 public async Task Add(string userId, [FromBody] ApiBasketAddRequest request)
 {
     try
     {
         IUserActor actor = GetActor(userId);
         if (request == null)
         {
             request = new ApiBasketAddRequest
             {
                 ProductId = Guid.NewGuid(),
                 Quantity  = 1
             };
         }
         await actor.AddToBasket(request.ProductId, request.Quantity);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.ToString());
     }
 }
Beispiel #3
0
        public async Task Add(string userId, [FromBody] ApiBasketAddRequest request)
        {
            IUserActor userActor = GetActor(userId);

            await userActor.AddToBasket(new Guid(request.ProductId), request.Quantity);
        }
Beispiel #4
0
        public async Task Add(string userId, [FromBody] BasketRequestItemViewModel request)
        {
            IUserActor actor = GetActor(userId);

            await actor.AddToBasket(request.ProductId, request.Quantity);
        }