コード例 #1
0
        public IMapExpressionPostRoot <MODEL> ViaAdhocRelation(string fromFieldName, string toTableName, string toFieldName, Action <IMapExpressionPostRoot <MODEL> > mapAction)
        {
            var childMapExpression = new MapExpression <MODEL>(MapVisitor);

            MapVisitor.Visit(new BeginAdHocRelation {
                ToTableFieldName = toFieldName, FromTableField = fromFieldName, ToTableName = toTableName
            });

            mapAction(childMapExpression);

            MapVisitor.Visit(new EndRelation());

            return(this);
        }
コード例 #2
0
        public virtual IMapExpressionPostRoot <MODEL> ViaRelation(string relationName, Action <IMapExpressionPostRoot <MODEL> > mapAction)
        {
            var childMapExpression = new MapExpression <MODEL>(MapVisitor);

            MapVisitor.Visit(new BeginRelation {
                RelationName = relationName
            });

            mapAction(childMapExpression);

            MapVisitor.Visit(new EndRelation());

            return(this);
        }
        public MapExpression <PARENTMODEL> ViaRelation(string relationName, Action <IMapExpressionPostRoot <CHILDMODEL> > mapAction)
        {
            var relationMapExpression = new MapExpression <CHILDMODEL>(_modelMapVisitor);

            _modelMapVisitor.Visit(new BeginRelation {
                RelationName = relationName
            });

            mapAction(relationMapExpression);

            _modelMapVisitor.Visit(new EndRelation());
            _modelMapVisitor.Visit(new EndMapMany());

            return(_parentMapExpression);
        }
        public MapExpression <PARENTMODEL> ViaAdhocRelation(string fromFieldName, string toTableName, string toFieldName, Action <IMapExpressionPostRoot <CHILDMODEL> > mapAction)
        {
            var relationMapExpression = new MapExpression <CHILDMODEL>(_modelMapVisitor);

            _modelMapVisitor.Visit(new BeginAdHocRelation
            {
                ToTableFieldName = toFieldName,
                FromTableField   = fromFieldName,
                ToTableName      = toTableName
            });

            mapAction(relationMapExpression);

            _modelMapVisitor.Visit(new EndRelation());
            _modelMapVisitor.Visit(new EndMapMany());

            return(_parentMapExpression);
        }
 public MapRelatedModelExpression(MapExpression <PARENTMODEL> parentMapExpression, IModelMapVisitor modelMapVisitor)
 {
     _parentMapExpression = parentMapExpression;
     _modelMapVisitor     = modelMapVisitor;
 }