Click here to Skip to main content
15,891,708 members
Articles / Programming Languages / C#

Comparing Transparent Lazy Loading between NHibernate and Entity Framework

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
14 Jan 2012CPOL7 min read 35.8K   920   23  
In this article, I will explain what transparent lazy loading is and how it's implemented in NHibernate and Entity Framework.
  • LazyLoadingEntityFramework_src.zip
  • CreatTables_sql.zip
  • LazyLoadingNHibernate_src.zip
    • LazyLoadingNHibernate
      • Demo.Tests
      • Demo
      • LazyLoadingNHibernate.sln
      • LazyLoadingNHibernate.vsmdi
      • Library
        • Iesi.Collections.dll
        • NHibernate.dll
      • Local.testsettings
      • TestResults
        • Henry_LAPTOP 2012-01-13 20_27_04.trx
        • Henry_LAPTOP 2012-01-13 20_29_28.trx
        • Henry_LAPTOP 2012-01-13 20_31_42.trx
        • Henry_LAPTOP 2012-01-13 20_32_42.trx
        • Henry_LAPTOP 2012-01-13 20_36_10.trx
        • Henry_LAPTOP 2012-01-13 20_36_10
          • In
            • LAPTOP
          • Out
            • AgentRestart.dat
        • Henry_LAPTOP 2012-01-13 20_37_05.trx
        • Henry_LAPTOP 2012-01-13 20_37_19.trx
        • Henry_LAPTOP 2012-01-13 20_40_25.trx
        • Henry_LAPTOP 2012-01-13 20_43_37.trx
        • Henry_LAPTOP 2012-01-13 20_43_37
          • In
            • LAPTOP
          • Out
            • AgentRestart.dat
        • Henry_LAPTOP 2012-01-13 20_46_24.trx
        • Henry_LAPTOP 2012-01-13 20_46_24
          • In
            • LAPTOP
          • Out
            • AgentRestart.dat
        • Henry_LAPTOP 2012-01-13 20_50_33.trx
        • Henry_LAPTOP 2012-01-13 20_50_33
          • In
            • LAPTOP
          • Out
            • AgentRestart.dat
        • Henry_LAPTOP 2012-01-13 20_50_58.trx
        • Henry_LAPTOP 2012-01-13 20_50_58
          • In
            • LAPTOP
          • Out
            • AgentRestart.dat
        • Henry_LAPTOP 2012-01-13 20_56_53.trx
        • Henry_LAPTOP 2012-01-13 20_57_27.trx
        • Henry_LAPTOP 2012-01-13 20_57_57.trx
        • Henry_LAPTOP 2012-01-13 20_58_28.trx
        • Henry_LAPTOP 2012-01-13 20_58_28
          • In
            • LAPTOP
          • Out
            • AgentRestart.dat
        • Henry_LAPTOP 2012-01-13 21_01_34.trx
        • Henry_LAPTOP 2012-01-13 21_01_42.trx
        • Henry_LAPTOP 2012-01-13 21_02_01.trx
        • Henry_LAPTOP 2012-01-13 21_02_01
          • In
            • LAPTOP
          • Out
            • AgentRestart.dat
      • TraceAndTestImpact.testsettings
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Demo" namespace="Demo">
  <class name="Task">
    <id name="TaskID">
      <generator class="identity" />
    </id>
    <property name="Name" />
    <many-to-one name="Employee" column="EmployeeID" class="Demo.Employee" />
  </class>
</hibernate-mapping> 

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
Senior Software Developer from New Jersey, USA

Have 15+ years experience on enterprise application development with various technologies.

Comments and Discussions