/// <summary> /// Maps the parent part. /// </summary> /// <typeparam name="T">The type being mapped.</typeparam> /// <param name="parentPart">The parent part.</param> /// <param name="foreignKeyName">Name of the foreign key.</param> public static void MapParentPart <T> (this OneToOnePart <T> parentPart, string foreignKeyName) { parentPart .Access.BackingField() .Constrained() .ForeignKey(foreignKeyName); }
protected EntityExtensionMap() { Id(extension => extension.Id) .Column(typeof(TExtended).Name + "_id") .GeneratedBy.Foreign("Owner"); OwnerReference = HasOne(e => e.Owner) .Constrained() .Not.LazyLoad() .ForeignKey(string.Format("{0}_{1}_Extension_FK", typeof(TExtended).Name, typeof(TEntity).Name)); }
/// <summary> /// Maps the child part. /// </summary> /// <typeparam name="T">The type being mapped.</typeparam> /// <param name="childPart">The child part.</param> public static void MapChildPart <T> (this OneToOnePart <T> childPart) { childPart .Cascade.All() .Access.CamelCaseField(Prefix.Underscore); }