We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CREATE TABLE "public"."Untitled" ( "PayOrderId" varchar(50) COLLATE "pg_catalog"."default" NOT NULL, "Money" money NOT NULL, "OrderTime" timestamptz(6) );
[JsonObject(MemberSerialization.OptIn), Table(Name = "pay_order", DisableSyncStructure = true)] public partial class PayOrder { /// <summary> /// 收款金额 /// </summary> [JsonProperty, Column(DbType = "money")] public decimal Money { get; set; } /// <summary> /// 订单时间 /// </summary> [JsonProperty, Column(DbType = "timestamptz")] public DateTime? OrderTime { get; set; } /// <summary> /// 支付Id /// </summary> [JsonProperty, Column(StringLength = 50)] public string PayOrderId { get; set; } }
var orderSql = fsql .Select<PayOrder>() .As(nameof(PayOrder).ToLower()) .Where(p => p.Status == 1) .ToSql(p => new { p.PayOrderId, p.Money, p.OrderTime }, FreeSql.FieldAliasOptions.AsProperty);
SELECT payorder."PayOrderId" PayOrderId, payorder."Money" Money, payorder."OrderTime" OrderTime FROM "pay_order" payorder WHERE (payorder."Status" = 1)
pgsql是区分大小写的,故sql语句中payorder."PayOrderId" PayOrderId的别名PayOrderId实际需要加上双引号,不然会在后续的查询中因为大小写导致无法找到PayOrderId
payorder."PayOrderId" PayOrderId
PayOrderId
The text was updated successfully, but these errors were encountered:
- 优化 ToSql FieldAliasOptions.AsProperty 别名问题;#467
3c812d4
v1.9.0 #467 #462 #456 #454 #450 #446 #445 #443 #380 #361 #278 #197
5a66418
感谢反馈,问题是否得到解决
Sorry, something went wrong.
- 优化 ToSql 别名大小写问题;#467
b193d86
v2.3.0-preview1203 (myget.org) #467
7323b2d
No branches or pull requests
表结构
PayOrder类
查询代码
生成sql语句
pgsql是区分大小写的,故sql语句中
payorder."PayOrderId" PayOrderId
的别名PayOrderId实际需要加上双引号,不然会在后续的查询中因为大小写导致无法找到PayOrderId
The text was updated successfully, but these errors were encountered: