Exemple #1
0
        public MultipleRelKeyDefBuilder <T, TRelatedType> WithMultipleRelationship <TRelatedType>(string relationshipName) where TRelatedType : BusinessObject
        {
            MultipleRelationshipDefBuilder <T, TRelatedType> multipleRelationshipDefBuilder = new MultipleRelationshipDefBuilder <T, TRelatedType>(this);

            multipleRelationshipDefBuilder.WithRelationshipName(relationshipName);
            _multipleRelationshipDefBuilders.Add(multipleRelationshipDefBuilder);
            var relKeyDefBuilder = new MultipleRelKeyDefBuilder <T, TRelatedType>(multipleRelationshipDefBuilder);

            multipleRelationshipDefBuilder.MultipleRelKeyDefBuilder = relKeyDefBuilder;
            return(relKeyDefBuilder);
        }
Exemple #2
0
        public MultipleRelKeyDefBuilder <T, TBusinessObject> WithMultipleRelationship <TBusinessObject>(Expression <Func <T, BusinessObjectCollection <TBusinessObject> > > relationshipExpression)
            where TBusinessObject : class, IBusinessObject, new()
        {
            string relationshipName = GetPropertyName(relationshipExpression);
            MultipleRelationshipDefBuilder <T, TBusinessObject> multipleRelationshipDefBuilder = new MultipleRelationshipDefBuilder <T, TBusinessObject>(this);

            multipleRelationshipDefBuilder.WithRelationshipName(relationshipName);
            _multipleRelationshipDefBuilders.Add(multipleRelationshipDefBuilder);
            var relKeyDefBuilder = new MultipleRelKeyDefBuilder <T, TBusinessObject>(multipleRelationshipDefBuilder);

            multipleRelationshipDefBuilder.MultipleRelKeyDefBuilder = relKeyDefBuilder;
            return(relKeyDefBuilder);
        }
//        private readonly MultipleRelationshipDefBuilder<T, TRelatedType> _relBuilder;

        public MultipleRelKeyBuilder(MultipleRelationshipDefBuilder <T, TRelatedType> multipleRelationshipDefBuilder)
        {
            _multipleRelationshipDefBuilder = multipleRelationshipDefBuilder;
            _relKeyDef = new RelKeyDef();
        }