protected override void Apply(IConventionFinder conventionFinder) { conventionFinder.Add<Dao.NHibernate.Extension.Convention.UpperCaseTableName.Convention>(); conventionFinder.Add<Dao.NHibernate.Extension.Convention.UpperCaseColumnName.Convention>(); conventionFinder.Add<Dao.NHibernate.Extension.Convention.UpperCaseString.Convention>(); conventionFinder.Add(new Dao.NHibernate.Extension.Convention.TablePrefix.Convention("X")); }
public void Apply(string sessionAlias, IConventionFinder conventionFinder) { foreach (IConventionApplier item in items) { item.Apply(sessionAlias, conventionFinder); } }
public void Apply(string sessionAlias, IConventionFinder conventionFinder) { foreach (IConventionApplier item in items) { item.Apply(sessionAlias, conventionFinder); } }
protected override void Apply(IConventionFinder conventionFinder) { conventionFinder.Add <Dao.NHibernate.Extension.Convention.UpperCaseTableName.Convention>(); conventionFinder.Add <Dao.NHibernate.Extension.Convention.UpperCaseColumnName.Convention>(); conventionFinder.Add <Dao.NHibernate.Extension.Convention.UpperCaseString.Convention>(); conventionFinder.Add(new Dao.NHibernate.Extension.Convention.TablePrefix.Convention("X")); }
/// <summary> /// Map the convention. /// </summary> /// <param name="finder">Convention finder.</param> public virtual void Build(IConventionFinder finder) { finder.Add <PrimaryKeyConvention>(); finder.Add <PrimaryKeyGuidConvention>(); finder.Add(DefaultCascade.None()); finder.Add(ForeignKey.EndsWith("Id")); }
private static void ConfigureConventions(IConventionFinder conventions) { conventions.Add(DefaultCascade.All()); conventions.Add(DefaultLazy.Always()); conventions.Add(ConventionBuilder.Id.Always(convention => convention.GeneratedBy.GuidComb())); conventions.Add(ConventionBuilder.HasMany.Always(convention => convention.Inverse())); conventions.Add(ConventionBuilder.HasMany.Always(convention => convention.Cascade.AllDeleteOrphan())); }
public PersistenceModel(IConventionFinder conventionFinder) { mappings = new List<IMappingProvider>(); visitors = new List<IMappingModelVisitor>(); ConventionFinder = conventionFinder; AddDiscoveryConventions(); }
public void CreatePersistenceModel() { conventionFinder = MockRepository.GenerateMock<IConventionFinder>(); model = new PersistenceModel(conventionFinder); cfg = Fluently.Configure() .Database(SQLiteConfiguration.Standard.InMemory) .BuildConfiguration(); }
public PersistenceModel(IConventionFinder conventionFinder) { Conventions = conventionFinder; visitors.Add(new SeparateSubclassVisitor(subclassProviders)); visitors.Add(new BiDirectionalManyToManyPairingVisitor()); visitors.Add(new ManyToManyTableNameVisitor()); visitors.Add(new ConventionVisitor(Conventions)); }
protected override void Apply(IConventionFinder conventionFinder) { conventionFinder.Add <Dao.NHibernate.Extension.Convention.UpperCaseTableName.Convention>(); conventionFinder.Add <Dao.NHibernate.Extension.Convention.UpperCaseColumnName.Convention>(); //conventionFinder.Add<NHibernate.Extension.Convention.UpperCaseString.Convention>(); conventionFinder.Add(new Dao.NHibernate.Extension.Convention.TablePrefix.Convention("X")); conventionFinder.Add(new Dao.NHibernate.Extension.Convention.Eumeration.Convention()); conventionFinder.Add(DynamicUpdate.AlwaysTrue()); }
protected override void Apply(IConventionFinder conventionFinder) { conventionFinder.Add<Dao.NHibernate.Extension.Convention.UpperCaseTableName.Convention>(); conventionFinder.Add<Dao.NHibernate.Extension.Convention.UpperCaseColumnName.Convention>(); //conventionFinder.Add<NHibernate.Extension.Convention.UpperCaseString.Convention>(); conventionFinder.Add(new Dao.NHibernate.Extension.Convention.TablePrefix.Convention("X")); conventionFinder.Add(new Dao.NHibernate.Extension.Convention.Eumeration.Convention()); conventionFinder.Add(DynamicUpdate.AlwaysTrue()); }
public void Apply(string sessionAlias, IConventionFinder conventionFinder) { if (sessionAlias != this.sessionAlias) { return; } Apply(conventionFinder); }
public void CreatePersistenceModel() { conventionFinder = MockRepository.GenerateMock<IConventionFinder>(); model = new PersistenceModel(conventionFinder); TempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); RemoveArtifacts(); Directory.CreateDirectory(TempDir); }
public ConventionVisitor(IConventionFinder finder) { collections = new Dictionary <Collection, Action <MappingModel.Collections.CollectionMapping> > { { Collection.Array, ProcessArray }, { Collection.Bag, ProcessBag }, { Collection.Map, ProcessMap }, { Collection.List, ProcessList }, { Collection.Set, ProcessSet }, }; this.finder = finder; }
public virtual IEnumerable<IAutomappingStep> GetMappingSteps(AutoMapper mapper, IConventionFinder conventionFinder) { return new IAutomappingStep[] { new IdentityStep(this), new VersionStep(this), new ComponentStep(this, mapper), new PropertyStep(conventionFinder, this), new HasManyToManyStep(this), new ReferenceStep(this), new HasManyStep(this) }; }
/// <summary> /// The add conventions. /// </summary> /// <param name="conventions"> /// The conventions. /// </param> protected virtual void AddConventions(IConventionFinder conventions) { // uncomment lines if needed conventions.Add(new ForeignKeyConstraintHasManyNameConvention()); conventions.Add(new ForeignKeyConstraintReferenceNameConvention()); conventions.Add(new ForeignKeyNameConvention()); conventions.Add(new ManyToManyNameConvention()); conventions.Add(new ReferenceNameConvention()); conventions.Add(new ForeignKeyConstraintHasManyToManyNameConvention()); conventions.Add(new TableNameConvention()); conventions.Add(new PrimaryKeyNameConvention()); conventions.Add(new PropertyNameConvention()); conventions.Add(new EnumConvention()); }
public PersistenceModel(IConventionFinder conventionFinder) { BiDirectionalManyToManyPairer = (c, o, w) => {}; Conventions = conventionFinder; visitors.Add(new SeparateSubclassVisitor(subclassProviders)); visitors.Add(new ComponentReferenceResolutionVisitor(componentResolvers, componentProviders)); visitors.Add(new RelationshipPairingVisitor(BiDirectionalManyToManyPairer)); visitors.Add(new ManyToManyTableNameVisitor()); visitors.Add(new ConventionVisitor(Conventions)); visitors.Add(new ComponentColumnPrefixVisitor()); visitors.Add(new RelationshipKeyPairingVisitor()); visitors.Add((validationVisitor = new ValidationVisitor())); }
public AutoMapper(AutoMappingExpressions expressions, IConventionFinder conventionFinder, IEnumerable <InlineOverride> inlineOverrides) { this.expressions = expressions; this.inlineOverrides = inlineOverrides; mappingRules = new List <IAutoMapper> { new AutoMapIdentity(expressions), new AutoMapVersion(), new AutoMapComponent(expressions, this), new AutoMapProperty(conventionFinder, expressions), new AutoMapManyToMany(expressions), new AutoMapManyToOne(), new AutoMapOneToMany(expressions), }; }
public AutoMapper(AutoMappingExpressions expressions, IConventionFinder conventionFinder, IEnumerable<InlineOverride> inlineOverrides) { this.expressions = expressions; this.inlineOverrides = inlineOverrides; mappingRules = new List<IAutoMapper> { new AutoMapIdentity(expressions), new AutoMapVersion(), new AutoMapComponent(expressions, this), new AutoMapProperty(conventionFinder, expressions), new AutoMapManyToMany(expressions), new AutoMapManyToOne(), new AutoMapOneToMany(expressions), }; }
public virtual void AddHasManyConvention(IConventionFinder conventionFinder) { conventionFinder.Add <HasManyConvention>(); }
public ConventionWithIConventionFinderConstructor(IConventionFinder conventionFinder) { }
public void CreateConvention() { conventionFinder = MockRepository.GenerateMock<IConventionFinder>(); convention = new JoinMappingPartDiscoveryConvention(conventionFinder); }
public AutoMapProperty(IConventionFinder conventionFinder, AutoMappingExpressions expressions) { this.conventionFinder = conventionFinder; this.expressions = expressions; }
public void Merge(IConventionFinder conventionFinder) { conventions.Merge(conventionFinder.Conventions); }
public void CreatePersistenceModel() { conventionFinder = MockRepository.GenerateMock<IConventionFinder>(); model = new PersistenceModel(conventionFinder); }
public PropertyDiscoveryConvention(IConventionFinder conventionFinder) { this.conventionFinder = conventionFinder; }
public ReferenceDiscoveryConvention(IConventionFinder conventionFinder) { this.conventionFinder = conventionFinder; }
public VersionDiscoveryConvention(IConventionFinder conventionFinder) { this.conventionFinder = conventionFinder; }
public PersistenceModel(IConventionFinder conventionFinder) { Conventions = conventionFinder; visitors.Add(new SeparateSubclassVisitor(subclassProviders)); visitors.Add(new BiDirectionalManyToManyPairingVisitor()); visitors.Add(new ManyToManyTableNameVisitor()); visitors.Add(new ConventionVisitor(Conventions)); }
public void CreateConvention() { conventionFinder = MockRepository.GenerateMock<IConventionFinder>(); convention = new HasManyToManyDiscoveryConvention(conventionFinder); }
public void Apply(string sessionAlias, IConventionFinder conventionFinder) { conventionFinder.Add(new Dao.NHibernate.Extension.Convention.TablePrefix.Convention("DTC")); }
public ConventionWithIConventionFinderConstructor(IConventionFinder conventionFinder) { }
public virtual void AddTableNameConvention(IConventionFinder conventionFinder) { conventionFinder.Add <TableNameConvention>(); }
public HasManyToManyDiscoveryConvention(IConventionFinder conventionFinder) { this.conventionFinder = conventionFinder; }
internal PrivateAutoMapper(AutoMappingExpressions expressions, IConventionFinder conventionFinder, IEnumerable<InlineOverride> inlineOverrides) : base(expressions, conventionFinder, inlineOverrides) { localExpressions = expressions; }
public SetupConventionFinder(TReturn container, IConventionFinder conventionFinder) { parent = container; this.conventionFinder = conventionFinder; }
public PropertyStep(IConventionFinder conventionFinder, IAutomappingConfiguration cfg) { this.conventionFinder = conventionFinder; this.cfg = cfg; }
public override IEnumerable <IAutomappingStep> GetMappingSteps(AutoMapper mapper, IConventionFinder conventionFinder) { return(base.GetMappingSteps(mapper, conventionFinder).Select(x => x.GetType() == typeof(HasManyStep) ? new MyMa(x) : x)); }
public ConventionVisitor(IConventionFinder finder) { this.finder = finder; }
void IConventionFinder.Merge(IConventionFinder other) { conventionFinder.Merge(other); }
public DummyClassAssemblyConvention(IConventionFinder finder) { }
public HasOneDiscoveryConvention(IConventionFinder conventionFinder) { this.conventionFinder = conventionFinder; }
public void CreateConvention() { conventionFinder = MockRepository.GenerateMock<IConventionFinder>(); convention = new ReferenceDiscoveryConvention(conventionFinder); }
public SubclassDiscoveryConvention(IConventionFinder conventionFinder) { this.conventionFinder = conventionFinder; }
internal ConventionFinderAdapter(IConventionFinder finder) { Finder = finder; }
public virtual void AddPrimaryKeyConvention(IConventionFinder conventionFinder) { conventionFinder.Add <PrimaryKeyConvention>(); }
internal static IList <IConvention> ToList(this IConventionFinder finder) { return(new ConventionFinderAdapter(finder)); }
public virtual void AddManyToManyConvention(IConventionFinder conventionFinder) { conventionFinder.Add <ManyToManyConvention>(); }
public void CreateConvention() { conventionFinder = MockRepository.GenerateMock<IConventionFinder>(); convention = new JoinedSubclassDiscoveryConvention(conventionFinder); }
public virtual void AddReferenceConvention(IConventionFinder conventionFinder) { conventionFinder.Add <ReferenceConvention>(); }
/* private static Action<AutoMappingExpressions> GetSetup() { return c => { c.FindIdentity = member => member.Name == "Id"; c.IsConcreteBaseType = IsBaseTypeConvention; c.AbstractClassIsLayerSupertype = type => !IsDomainEntity(type); c.IsComponentType = IsComponentTypeConvention; }; } private static bool IsDomainEntity(Type type) { return GetAutoMappingFilter(type) && type.Assembly == typeof(Player).Assembly && type != typeof(SummarisableEntity); }*/ /// <summary> /// This project's conventions (which may be changed) are as follows: /// * Table names are plural /// * The Id of an object is "Id" /// * Foreign keys are "ObjectNameFk" /// * One-to-Many relationships cascade "All" /// /// Feel free to change this to your project's needs! /// </summary> private static void GetConventions(IConventionFinder finder) { finder.Add(Table.Is(map => Inflector.Net.Inflector.Pluralize(map.EntityType.Name))); //c.FindIdentity = type => type.Name == "Id"; finder.Add(PrimaryKey.Name.Is(map => "Id")); //c.GetForeignKeyName = type => type.Name + "Fk"; finder.Add(ForeignKey.EndsWith("Fk")); //c.GetForeignKeyNameOfParent = type => type.Name + "Fk"; //c.OneToManyConvention = o => o.Cascade.All(); finder.Add(ConventionBuilder.Reference.Always(r => r.Cascade.SaveUpdate())); finder.Add(ConventionBuilder.HasMany.Always(r => r.Cascade.All())); finder.Add(ConventionBuilder.HasManyToMany.Always(r => r.Cascade.All())); //finder.Add(new RequiredConvention()); //finder.Add(new SetConvention()); //finder.Add(new BlobDocumentConvention()); //finder.Add(new StringLengthConvention()); //finder.Add(new ValueTypePropertyConvention()); }
public AutoMapper(IAutomappingConfiguration cfg, IConventionFinder conventionFinder, IEnumerable <InlineOverride> inlineOverrides) { this.cfg = cfg; this.conventionFinder = conventionFinder; this.inlineOverrides = inlineOverrides; }
public AutoMapper(IAutomappingConfiguration cfg, IConventionFinder conventionFinder, IEnumerable<InlineOverride> inlineOverrides) { this.cfg = cfg; this.conventionFinder = conventionFinder; this.inlineOverrides = inlineOverrides; }
public virtual IEnumerable <IAutomappingStep> GetMappingSteps(AutoMapper mapper, IConventionFinder conventionFinder) { return(new IAutomappingStep[] { new IdentityStep(this), new VersionStep(this), new ComponentStep(this), new PropertyStep(conventionFinder, this), new HasManyToManyStep(this), new ReferenceStep(this), new HasManyStep(this) }); }
public void CreateConvention() { conventionFinder = MockRepository.GenerateMock<IConventionFinder>(); convention = new DynamicComponentDiscoveryConvention(conventionFinder); }
public void Apply(string sessionAlias, IConventionFinder conventionFinder) { conventionFinder.Add(new Dao.NHibernate.Extension.Convention.TablePrefix.Convention("DTC")); }
public DynamicComponentDiscoveryConvention(IConventionFinder conventionFinder) { this.conventionFinder = conventionFinder; }
public PropertyStep(IConventionFinder conventionFinder, IAutomappingConfiguration cfg) { this.conventionFinder = conventionFinder; this.cfg = cfg; }
public AutoMapProperty(IConventionFinder conventionFinder, AutoMappingExpressions expressions) { this.conventionFinder = conventionFinder; this.expressions = expressions; }