Is there a simple solution to make lazy load for nonnavigation property in the EF 4.1? For example, for byte array.
相关问题
- Lazily Reading a File in D
- Using StoreGeneratedPattern.Identity with database
- CreateFileMapping ends with “Not enough disk space
- Specify a cascading delete for parent / child rela
- Entity Framework 4.1 - Code First: many-to-many re
相关文章
- Is there a way to modify the entity mapping config
- Routing to sub routing module without lazy loading
- Lazy Load VS infinite scrolling
- Should we disable lazy loading of Entity Framework
- Does AsQueryable() on ICollection really makes laz
- Intermediate variable in a list comprehension for
- Selenium find_elements_by_id() doesn't return
- Excel VBA - Dictionary - storing and retrieving va
I can't think of any situation where you'd desire a lazy loaded column in a table and couldn't justify putting it in its own table and mapping a separate entity to represent it. If you want a column lazy loaded, its probably a good indication that you need to create a separate entity. If you are mapping EF to a legacy database, then ignore everything I just said.
No EF doesn't provide lazy loading for scalar and complex properties. The trick is to use table splitting where data from single table are mapped into two entities related with one-to-one relation. One entity is the principal and it contains navigation property to the dependent and because of that you can use lazy loading. Here is the question with link how to do it in EDMX and the answer provides solution for mapping in code-first (comments contains link to another example in MSDN forum).