Auto Increment (Identity) does not work in Fluent NHibernate

Viewed 3052

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.

enter image description here

Why auto increment (identity) does not work?

1 Answers
Related