public interface IRepository<TEntity>
{
TEntity FindById(Guid id);
void Add(TEntity entity);
void Remove(TEntity entity);
}
This is a simple generic repository. If I have a Product
entity, this repository can insert, update, and delete (using Entity Framework).
But I have report based types that I created.
For example:
- Products that grouped by salesmen.
Number of orders sent by each shipper.
public class OrdersWithShipper { public string ShipperName{get;set;} public string NumberOfOrder{get;set;} }
And so on.
So I should create complex queries to many tables that related. But query result object is not representing with repository TEntity
entity type.
I have many report type like this. How can I solve this problem?