本文整理汇总了C#中AutoPersistenceModel.Setup方法的典型用法代码示例。如果您正苦于以下问题:C# AutoPersistenceModel.Setup方法的具体用法?C# AutoPersistenceModel.Setup怎么用?C# AutoPersistenceModel.Setup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AutoPersistenceModel
的用法示例。
在下文中一共展示了AutoPersistenceModel.Setup方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SagaPersistenceModel
public static AutoPersistenceModel SagaPersistenceModel(IEnumerable<Type> typesToScan)
{
var sagaEntites = typesToScan.Where(t => typeof(ISagaEntity).IsAssignableFrom(t) && !t.IsInterface);
var model = new AutoPersistenceModel();
model.Conventions.AddFromAssemblyOf<IdShouldBeAssignedConvention>();
var entityTypes = GetTypesThatShouldBeAutoMapped(sagaEntites,typesToScan);
var assembliesContainingSagas = sagaEntites.Select(t => t.Assembly).Distinct();
foreach (var assembly in assembliesContainingSagas)
model.AddEntityAssembly(assembly)
.Where(t => entityTypes.Contains(t));
var componentTypes = GetTypesThatShouldBeMappedAsComponents(sagaEntites);
model.Setup(s =>
{
s.IsComponentType =
type => componentTypes.Contains(type);
});
return model;
}
示例2: Generate
public AutoPersistenceModel Generate()
{
var mappings = new AutoPersistenceModel();
mappings.AddEntityAssembly(typeof (Class1).Assembly).Where(GetAutoMappingFilter);
mappings.Conventions.Setup(GetConventions());
mappings.Setup(GetSetup());
mappings.UseOverridesFromAssemblyOf<AutoPersistenceModelGenerator>();
return mappings;
}
示例3: Generate
public AutoPersistenceModel Generate()
{
var mappings = new AutoPersistenceModel();
mappings.AddEntityAssembly(typeof (Post).Assembly).Where(GetAutoMappingFilter);
mappings.Conventions.Setup(GetConventions());
mappings.Setup(GetSetup());
mappings.IgnoreBase<Entity>();
mappings.IgnoreBase(typeof (EntityWithTypedId<>));
mappings.UseOverridesFromAssemblyOf<AutoPersistenceModelGenerator>();
return mappings;
}
示例4: Generate
public AutoPersistenceModel Generate()
{
var mappings = new AutoPersistenceModel();
mappings.AddEntityAssembly(typeof (Class1).Assembly).Where(GetAutoMappingFilter);
mappings.Conventions.Setup(GetConventions());
mappings.Setup(GetSetup());
mappings.UseOverridesFromAssemblyOf<AutoPersistenceModelGenerator>();
mappings.Override<Idea>(i => i.Map(m => m.Text).CustomSqlType("TEXT"));
mappings.Override<Comment>(c => c.Map(m => m.Text).CustomSqlType("TEXT"));
return mappings;
}
示例5: Generate
public AutoPersistenceModel Generate()
{
var mappings = new AutoPersistenceModel();
mappings = AutoMap.AssemblyOf<Domain.Entity>();
mappings.Where(GetAutoMappingFilter);
mappings.Conventions.Setup(GetConventions());
mappings.UseOverridesFromAssemblyOf<AutoPersistenceModelGenerator>();
mappings.Setup(GetSetup());
mappings.OverrideAll(x => x.IgnoreProperties(z => z.PropertyType.IsSubclassOf(typeof(Enumeration))));
mappings.IgnoreBase<Domain.Entity>();
mappings.UseOverridesFromAssemblyOf<AutoPersistenceModelGenerator>();
return mappings;
}
示例6: Generate
public AutoPersistenceModel Generate()
{
var mappings = new AutoPersistenceModel();
mappings.AddEntityAssembly(typeof(Soul).Assembly).Where(GetAutoMappingFilter);
mappings.Conventions.Setup(GetConventions());
mappings.Setup(GetSetup());
mappings.IgnoreBase<Entity>();
mappings.IgnoreBase(typeof(EntityWithTypedId<>));
mappings.UseOverridesFromAssemblyOf<AutoPersistenceModelGenerator>();
// Membershipprovider Automappings
mappings.AddEntityAssembly(typeof(Shaml.Membership.Core.User).Assembly).Where(GetAutoMappingFilter);
mappings.Override<Shaml.Membership.Core.User>(map => Shaml.Membership.Data.Overrides.UserOverride(map));
mappings.Override<Shaml.Membership.Core.Role>(map => Shaml.Membership.Data.Overrides.RoleOverride(map));
mappings.Override<Shaml.Membership.Core.ProfileData>(map => Shaml.Membership.Data.Overrides.ProfileDataOverride(map));
mappings.Override<Shaml.Membership.Core.Session>(map => Shaml.Membership.Data.Overrides.SessionOverride(map));
return mappings;
}