I read Tim McCarthy's amazing book on DDD in .NET . However, in his sample application, his basic data access uses SqlCE, and he manually uses embedded SQL.
I played with some templates to use the Entity Framework, but I was stuck on how to map linq queries exactly in IRepository at a basic level of data access.
I have a specific repository implementation.
public EFCustomerRepository : IRepository<DomainEntities.Customer> { IEnumerable<DomainEntities.Customer> GetAll( Expression<Func<DomainEntities.Customer, bool>> predicate) {
In my EF model, I use POCO objects, but even there will be no native mapping between my DomainEntity.Customer object and my DataAccessLayer.Customer objects.
so I canβt just pass Expression<Func<DomainEntities.Customer, bool>> predicate as a parameter for EFContext.Customers.Where(...);
Is there an easy way to map Expression<Func<T, bool>> predicate => Expression<Func<TOTHER, bool>> predicate
Or am I all wrong about this? Any suggestions / pointers appreciated.
Eoin campbell
source share