I need to map IQueryable<User>
to IQueryable<SimpleUser>
with ValueInjecter.
Is this possible?
I tried:
return userRepo.GetUsers()
.Select(o => new SimpleUser().InjectFrom(o))
.Cast<SimpleUser>();
But this cannot be translated to a stored expression...well, the method InjectFrom
.
Can automapper do this?
I want something similar to this:
return from i in userRepo.GetUsers()
select new SimpleUser{
i.UserId,
i.Name
};
but with using some kind of mapper tool.