If I want to run something like this
BLL.Person person = (BLL.Person)repository.Single(item => item.Id == Id);
Down in my single method I'd do something like this:
public Resource Single(Expression<Func<BLL.Resource, bool>> where)
{
Resource resource = AsQueryable().FirstOrDefault(where);
return resource;
}
protected IQueryable<BLL.Resource> AsQueryable()
{
// I need to use the where clause on an object called DAL.Resource
throw new NotImplementedException();
}
The DAL.Resource object is identical to the BLL.Resource, however the BLL copy is ignorant of persistence.. I can map things using automapper no problem to return a collection of what I want, however I need the where clause to run agaisnt DAL not BLL...
This must be possible somehow! Any ideas would be appreciated.