public static NaturalIdPart <T> Reference <T, TOther>(
            this NaturalIdPart <T> naturalIdPart,
            Expression <Func <T, TOther> > expression,
            Action <ManyToOnePart <TOther> > manyToOneAction)
        {
            naturalIdPart.ThrowIfNull("this");
            expression.ThrowIfNull("expression");
            manyToOneAction.ThrowIfNull("manyToOneAction");

            var manyToOnePart = new ManyToOnePart <TOther>(typeof(T), expression.ToMember());

            manyToOneAction(manyToOnePart);
            naturalIdPart.GetManyToOnes().Add((manyToOnePart as IManyToOneMappingProvider).GetManyToOneMapping());

            return(naturalIdPart);
        }
Exemplo n.º 2
0
 public static ManyToOnePart <TOther> Indexable <TOther>(this ManyToOnePart <TOther> manyToOnePart)
 {
     return(manyToOnePart.Index("___Indexable"));
 }
Exemplo n.º 3
0
        public static ManyToOnePart <TParent> CustomForeignKey <TParent>(this ManyToOnePart <TParent> parentReference, Type childType)
        {
            var name = string.Format("FK_{0}_child_to_{1}_Id", childType.Name, typeof(TParent).Name);

            return(parentReference.ForeignKey(name));
        }