I'm currently working with ASP.net MVC with repository pattern, the problem arise when we need to audit each entity.
I decided to utilize the change tracking feature which can track down the entity activity, the problem is when we need to involve several repository with it's private context object in one controller which is not supported by entity change tracker. example :
public SalesOrderController(INumberingRepository NumberRepository, IProductRepository ProductRepository, ISalesOrderRepository SalesOrderRepository)
{
this.productRepository = ProductRepository;
this.salesOrderRepository = SalesOrderRepository;
this.numberRepository = NumberRepository;
}
whereby each repository has it's own context.
is there any reference design so that entity framework change tracker feature can work happily with multiple repository context ?
Aucun commentaire:
Enregistrer un commentaire