public AutoPersistenceModel Generate()
        {
            AutoPersistenceModel mappings = AutoPersistenceModel
                                            .MapEntitiesFromAssemblyOf <Category>()
                                            .Where(GetAutoMappingFilter)
                                            .ConventionDiscovery.Setup(GetConventions())
                                            .WithSetup(GetSetup())
                                            .UseOverridesFromAssemblyOf <AutoPersistenceModelGenerator>();

            return(mappings);
        }
Пример #2
0
        public AutoPersistenceModel Generate()
        {
            AutoPersistenceModel mappings = AutoPersistenceModel
                                            // If you delete the default class, simply point the following line to an entity within the .Core layer
                                            .MapEntitiesFromAssemblyOf <Class1>()
                                            .Where(GetAutoMappingFilter)
                                            .ConventionDiscovery.Setup(GetConventions())
                                            .WithSetup(GetSetup())
                                            .UseOverridesFromAssemblyOf <AutoPersistenceModelGenerator>();

            return(mappings);
        }
Пример #3
0
 public NHibernatePersistenceModel()
 {
     _autoPersistenceModel = AutoPersistenceModel
                             .MapEntitiesFromAssemblyOf <DomainEntity>()
                             .WithAlterations(x =>
                                              x.Add <AutoMappingAlteration>())
                             .WithSetup(s =>
     {
         s.FindIdentity = type => type.Name == "ID";
         s.IsBaseType   = type => type == typeof(DomainEntity);
     })
                             //.Where(type =>
                             //    typeof (DomainEntity).IsAssignableFrom(type) &&
                             //    type.Namespace == "Fohjin.Core.Domain")
                             .ConventionDiscovery
                             .AddFromAssemblyOf <IdentityColumnConvention>()
                             .UseOverridesFromAssemblyOf <UserMappingOverride>();
 }