Giter Site home page Giter Site logo

nhibernate.asp.net's Introduction

NHibernateAsp.Net (Using NHibernate with Asp.net)

This is a sample project where I have added below things:

  • Simple NHiberanate uses.
  • Repository Pattern using NHibernate.
  • Test Project to test all samples
  • Using DI to inject Session object

To Run Project

Please create a database named as "NDemo" inside the SQL Server. I have used SQL2012 express edision.

Notes on NHibernate

  1. Database has to be created manually.
  2. Fluent API can be written to do Mapping install (FluentNHibernate version="1.4.0.0" targetFramework="net35" )
  3. Tables can be generated by Code First & Fluent APIs.
  4. Each complex type must have its own Mapper for reusability or it can be merged in Entity Mapper
  5. Each Entity must have its own Mapper
  6. Each Entity must have one internal empty constructor only if it has any non-empty constructor.
  7. Each Persisted Property has to be marked as Virtual.
  8. Private setter on property will not work ( it has to be protected/public internal set)
  9. Any setter method has to be marked as virtual.
  10. Batch insert is supported. However, Id has to be of type of GUID.
  11. Inheritance Not Supported For Value Objects, it has to be Entity.

Common Error

No persister for: User

Solution:
  1. Check if there is no Mapper class defined for that Entity or Component
  2. Make sure Mapper Class must be public

nhibernate.asp.net's People

Contributors

rupeshtiwari avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.