gpt4 book ai didi

c# - 在 Object Collection 中的 Entity 框架中拆分字符串,即在 New {} 中

转载 作者:行者123 更新时间:2023-12-02 00:47:18 26 4
gpt4 key购买 nike

<分区>

您好,我对 Entity Framework 查询有一个疑问。我从 Controller 中的一个操作返回了这个结果。

return q.select(t=> new 
{
date1,
date2,
Name,
Status
});

date1,date2 是数据库中返回逗号分隔日期的字符串字段。我只想从 date1 开始约会。但无法得到它。有人可以帮我安排第一次约会吗?我尝试了一些类似的东西

date1 = date1.split(',')[0]; 
date1 = date1.split(',').take(0).firstOrDefault();

但遇到这个错误

LINQ to Entities does not recognize the method 'System.String[] Split(Char[])' method, and this method cannot be translated into a store expression.

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com