forked from dotnet-architecture/eShopOnWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basket : Improve, reduce, remove duplication call to database (dotnet…
- Loading branch information
1 parent
47f69eb
commit 984740d
Showing
9 changed files
with
76 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
using System.Collections.Generic; | ||
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces | ||
{ | ||
public interface IBasketService | ||
{ | ||
Task TransferBasketAsync(string anonymousId, string userName); | ||
Task AddItemToBasket(int basketId, int catalogItemId, decimal price, int quantity = 1); | ||
Task SetQuantities(int basketId, Dictionary<string, int> quantities); | ||
Task<Basket> AddItemToBasket(string username, int catalogItemId, decimal price, int quantity = 1); | ||
Task<Basket> SetQuantities(int basketId, Dictionary<string, int> quantities); | ||
Task DeleteBasketAsync(int basketId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
using Microsoft.eShopWeb.Web.Pages.Basket; | ||
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate; | ||
using Microsoft.eShopWeb.Web.Pages.Basket; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.eShopWeb.Web.Interfaces | ||
{ | ||
public interface IBasketViewModelService | ||
{ | ||
Task<BasketViewModel> GetOrCreateBasketForUser(string userName); | ||
|
||
Task<int> CountTotalBasketItems(string username); | ||
|
||
Task<BasketViewModel> Map(Basket basket); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters