Linq to Sql query reuse
Posted
by
UserControl
on Stack Overflow
See other posts from Stack Overflow
or by UserControl
Published on 2012-07-02T09:13:18Z
Indexed on
2012/07/02
9:15 UTC
Read the original article
Hit count: 186
Let's say we have a view V1 and V2 that is declared like:
create view V2 as
select V1.*, V2.C1, V2.C2, V2.C3
from V1
join V2 on V1.Key = V2.Key
where bla-bla
So V2 narrows down the result set of V1 and adds some joins. And there is a retrieval routine in C#
IEnumerable<V1> GetData(MyFilter filter, MySortOrder order) {}
I want to reuse with V2. Is it possible without performing joins in L2S rather than in database? Should i manually create a base class in the database context or something?
© Stack Overflow or respective owner