Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 public MapRelatedModelExpression(MapExpression <PARENTMODEL> parentMapExpression, IModelMapVisitor modelMapVisitor)
 {
     _parentMapExpression = parentMapExpression;
     _modelMapVisitor     = modelMapVisitor;
 }