Skip to content

Commit 1d9aa84

Browse files
committed
interfaces added
1 parent 3c0c3eb commit 1d9aa84

File tree

4 files changed

+42
-2
lines changed

4 files changed

+42
-2
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using AspnetRunBasics.Entities;
2+
using System.Threading.Tasks;
3+
4+
namespace AspnetRunBasics.Repositories
5+
{
6+
public interface ICartRepository
7+
{
8+
Task<Cart> GetCartByUserName(string userName);
9+
Task AddItem(string userName, int productId);
10+
Task RemoveItem(int cartId, int cartItemId);
11+
Task ClearCart(string userName);
12+
}
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using AspnetRunBasics.Entities;
2+
using System.Collections.Generic;
3+
using System.Threading.Tasks;
4+
5+
namespace AspnetRunBasics.Repositories
6+
{
7+
public interface ICategoryRepository
8+
{
9+
Task<IEnumerable<Category>> GetCategories();
10+
}
11+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using AspnetRunBasics.Entities;
2+
using System.Threading.Tasks;
3+
4+
namespace AspnetRunBasics.Repositories
5+
{
6+
public interface IOrderRepository
7+
{
8+
Task<Order> CheckOut(Order orderModel);
9+
}
10+
}
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
using System;
1+
using AspnetRunBasics.Entities;
2+
using System;
23
using System.Collections.Generic;
34
using System.Linq;
45
using System.Threading.Tasks;
56

67
namespace AspnetRunBasics.Repositories
78
{
8-
public class IProductRepository
9+
public interface IProductRepository
910
{
11+
Task<IEnumerable<Product>> GetProductListAsync();
12+
Task<Product> GetProductByIdAsync(int id);
13+
Task<IEnumerable<Product>> GetProductByNameAsync(string name);
14+
Task<IEnumerable<Product>> GetProductByCategoryAsync(int categoryId);
15+
Task<IEnumerable<Category>> GetCategories();
1016
}
1117
}

0 commit comments

Comments
 (0)