It might possible that I am getting it wrong but I have problem understanding following thing.
public interface ICustomerService : IService<Customer>
{
decimal CustomerOrderTotalByYear(string customerId, int year);
IEnumerable<Customer> CustomersByCompany(string companyName);
IEnumerable<CustomerOrder> GetCustomerOrder(string country);
}
For example If I take GetCustomerOrder the it actually implemented as Extension Method of IRepository<Customer> and implementation of customer service called that method. Every method in Service implementation is called to repository to get data. Why It Is like that ?
As per my reading and understanding of this Service Layer get Two repository IRepository<Order> , IRepository<Customer> and then implement method in Service it self rather then extention method of repository.
Please give some guideline for this if possible.
Note : This is not issue and may be some other type of design but I did not find place where I can put question.
public interface ICustomerService : IService<Customer>
{
decimal CustomerOrderTotalByYear(string customerId, int year);
IEnumerable<Customer> CustomersByCompany(string companyName);
IEnumerable<CustomerOrder> GetCustomerOrder(string country);
}
For example If I take GetCustomerOrder the it actually implemented as Extension Method of IRepository<Customer> and implementation of customer service called that method. Every method in Service implementation is called to repository to get data. Why It Is like that ?
As per my reading and understanding of this Service Layer get Two repository IRepository<Order> , IRepository<Customer> and then implement method in Service it self rather then extention method of repository.
Please give some guideline for this if possible.
Note : This is not issue and may be some other type of design but I did not find place where I can put question.