views:

214

answers:

2

I have an existing domain layer. I want to develop the persistence layer using Linq to SQL. I am currently using an external map file. I am trying to use lazy loading for my child collections but am unsuccessful. Is there a way to implement lazy loading using Linq to SQL but without using EntitySet or EntityRef.

+1  A: 

I can't guarantee that I'm up to the latest development of LTS, but previously you had to you use EntitySet/EntityRef to get lazy loading.

You're best bet is NHibernate if you want a PI-model.

Rune Sundling
That is my understanding too
Marc Gravell
A: 

(Not really answering the question.)

Entity Framework (aka. LINQ to Entities) in .NET 4 includes persistence ignorance support e.g. being able to map to POCO (Plain Old CLR Object1). See "Sneak Preview: Persistence Ignorance and POCO in Entity Framework 4.0 ".

1 I.e. Not requiring a base class or attributes.

Richard
For info, LINQ-to-SQL supported this (and both lazy and eager loading) in the initial release ;-p
Marc Gravell
@Marc: But not POCO
Richard