IMappingObjectExpression VisistMapTypeSelector(Expression exp) { if (!Utils.IsMapType(exp.Type)) { throw new NotSupportedException(exp.ToString()); } DbExpression dbExp = this.VisistExpression(exp); MappingFieldExpression ret = new MappingFieldExpression(exp.Type, dbExp); return(ret); }
public IMappingObjectExpression ToNewObjectExpression(DbSqlQueryExpression sqlQuery, DbTable table) { DbColumnAccessExpression cae = null; cae = MappingObjectExpressionHelper.ParseColumnAccessExpression(sqlQuery, table, this._exp); MappingFieldExpression mf = new MappingFieldExpression(this._type, cae); mf.NullChecking = MappingObjectExpressionHelper.TryGetOrAddNullChecking(sqlQuery, table, this.NullChecking); return(mf); }
/// <summary> /// a => a.Id a => a.Name a => a.User /// </summary> /// <param name="exp"></param> /// <returns></returns> protected override IMappingObjectExpression VisitMemberAccess(MemberExpression exp) { //create MappingFieldExpression object if exp is map type if (Utils.IsMapType(exp.Type)) { DbExpression dbExp = this.VisistExpression(exp); MappingFieldExpression ret = new MappingFieldExpression(exp.Type, dbExp); return(ret); } //如 a.Order a.User 等形式 return(this.VisitNavigationMember(exp)); }
/// <summary> /// a => a.Id a => a.Name a => a.User /// </summary> /// <param name="exp"></param> /// <returns></returns> protected override IMappingObjectExpression VisitMemberAccess(MemberExpression exp) { //create MappingFieldExpression object if exp is map type if (MappingTypeSystem.IsMappingType(exp.Type)) { DbExpression dbExp = this.ResolveExpression(exp); MappingFieldExpression ret = new MappingFieldExpression(exp.Type, dbExp); return(ret); } //如 a.Order a.User 等形式 return(this.ResolveComplexMember(exp)); }