Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Mapeamento da classe Categoria no NHibernate 3.2
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
You can’t perform that action at this time.