Refactoring and Adding Tests (#28)
* Introducing repository and refactoring services. Changing entities to use int keys everywhere. * Refactoring application services to live in web project and only reference repositories, not EF contexts. * Cleaning up implementations * Moving logic out of CatalogController Moving entity knowledge out of viewmodels. * Implementing specification includes better for catalogservice * Cleaning up and adding specification unit tests
This commit is contained in:
14
src/Web/Interfaces/IBasketService.cs
Normal file
14
src/Web/Interfaces/IBasketService.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Microsoft.eShopWeb.ViewModels;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ApplicationCore.Interfaces
|
||||
{
|
||||
public interface IBasketService
|
||||
{
|
||||
Task<BasketViewModel> GetBasket(int basketId);
|
||||
Task<BasketViewModel> CreateBasket();
|
||||
Task<BasketViewModel> CreateBasketForUser(string userId);
|
||||
|
||||
Task AddItemToBasket(int basketId, int catalogItemId, decimal price, int quantity);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ namespace Microsoft.eShopWeb.Services
|
||||
{
|
||||
public interface ICatalogService
|
||||
{
|
||||
Task<Catalog> GetCatalogItems(int pageIndex, int itemsPage, int? brandID, int? typeId);
|
||||
Task<CatalogIndexViewModel> GetCatalogItems(int pageIndex, int itemsPage, int? brandId, int? typeId);
|
||||
Task<IEnumerable<SelectListItem>> GetBrands();
|
||||
Task<IEnumerable<SelectListItem>> GetTypes();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user