Created
February 9, 2012 20:14
-
-
Save dgomesbr/1782770 to your computer and use it in GitHub Desktop.
Mapeamento da classe Categoria no NHibernate 3.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using NHibernate.Driver; | |
using NHibernate.Mapping.ByCode; | |
using NHibernate.Mapping.ByCode.Conformist; | |
namespace workshop_Entity | |
{ | |
public class Category | |
{ | |
public virtual int IdCategoria { get; set; } | |
public virtual string Nome { get; set; } | |
public virtual string Descricao { get; set; } | |
} | |
public class CategoryMap : ClassMapping<Category> | |
{ | |
public CategoryMap() | |
{ | |
Id(x => x.IdCategoria, m => m.Generator(Generators.Identity)); | |
Property(x => x.Nome, m => m.Length(SqlClientDriver.MaxSizeForLengthLimitedString + 1)); | |
Property(x => x.Descricao, m => m.Length(SqlClientDriver.MaxSizeForLengthLimitedString + 1)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment