I'm studying Fluent NHibernate now, and have a question about mapping. It's not an issue, but a best practice question.
I know that with Fluent NHibernate there is a new fluent mapping, and it requires a new Class for mapping fields that will be used by the Entity Class. I was wondering, if the Mapping Class is directly linked to the Entity Class (It will map exacly for the entity class), do best practices dictate that they can't be joined within the same .cs file? Please note that there will be no nesting here.
I.e.: There are Product and a ProductMap classes, both for a Product table on my database, so I'd place both classes within the same Product.cs, like the following:
namespace Business.Entity
{
public class Product
{
...
}
public class ProductMap : ClassMap<Product>
{
...
}
}
If the classes shouldn't be inside the same file, would you care to explain why, and maybe with real examples?
Thanks in advance!