I am a complete newbie with Fluent, and I am facing a problem, which is probably my own mistake.
I have a namespace containing 3 classes. Entity, EntityVersion, and Property. There is no inheritance between classes.
I am trying to display only the Entity class, but what happens is that all classes in the namespace are displayed. What am I doing wrong here?
private static ISessionFactory CreateSessionFactory()
{
return Fluently.Configure()
.Database(
MsSqlConfiguration.MsSql2005
.ConnectionString("Data Source=MSCHOPMAN\\SQLEXPRESS;Initial Catalog=framework;Integrated Security=SSPI"))
.Mappings(m =>
{
m.AutoMappings.Add(
AutoMap.AssemblyOf<Entity>()
.Where(t => t.Namespace == "Modules.Business.Entities")
)
.ExportTo("c:\\temp");
}
)
.ExposeConfiguration(BuildSchema)
.BuildSessionFactory();
}
And the Entity class:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using Modules.Data;
namespace Modules.Business.Entities
{
public class Entity
{
public virtual int Id { get; set; }
public virtual int ParentId { get; set; }
public virtual int TypeId { get; set; }
public Entity()
{
}
}
}
source
share