I'm using Fluent Nhibernate. Mapping class looks following:
public class CategoryMap : ClassMap<Category>
{
public CategoryMap()
{
Id(x => x.CategoryId).UniqueKey("CategoryId").GeneratedBy.Increment();
Map(x => x.CategoryName).Not.Nullable();
References(x => x.ParentCategory).Column("ParentCategoryId").Nullable();
}
}
It is creates table like i need but in SSMS i sight that's CategoryId is not identity.
Why auto increment (identity) does not work?
