如何解决GraphQL/Prisma,对象变异
System.Linq
上面是我的模式模型,下面是我的变异
using System.Linq;
...
foreach (string filepath in Directory.GetFiles(mainPath))
{
//Use .Date property of DateTime.
//****Actually,you even don't need .Date property,Sorting on DateTime gives precise result as it consider seconds as well.
lastModified = File.GetLastWriteTime(filepath).Date;
//Use Path function to get name without extension.
fileName = Path.GetFileNameWithoutExtension(filepath);
//Instead of storing string as datetime,store as `Datetime`.
//I would suggest change type of `lastModifiedDateofFile` from string to DateTime
fileProperties.Add(new FileProperties { lastModifiedDateofFile = lastModified fileName = fileName });
}
var result = fileProperties
.OrderByDescending(x => x.lastModifiedDateofFile) //Order list of fileProperty by desc
.ToArray(); //Convert to array
我想将 mealPlan 保存在数据库中,但我不确定对象部分,我如何存储来自 GraphQl 端点的数据?
我想我对这里的突变迷失了。
任何帮助将不胜感激
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。