FreeSql icon indicating copy to clipboard operation
FreeSql copied to clipboard

贪懒加载子集数据为null的问题

Open cesaryuan opened this issue 3 years ago • 2 comments

问题描述及重现步骤:

当贪婪加载子集数据(IncludeMany(x => x.Songs))时,若子集(Songs)类型为public Song[] Songs { get; set; }而不是public List<Song> Songs { get; set; }时,前者获取到的Songs为null,后者则正常。 建议这里如果为Array则抛出异常,并提醒用户更换为List

数据库的具体版本

无关

安装的包

image

.net framework/. net core? 及具体版本

.net core 6

cesaryuan avatar Jul 10 '22 11:07 cesaryuan

可以是 ICollection,ObservableCollection,List 类型,不可以数组,因为数组类型对一些功能有限制。

2881099 avatar Jul 10 '22 11:07 2881099

可以是 ICollection,ObservableCollection,List 类型,不可以数组,因为数组类型对一些功能有限制。

嗯嗯,希望可以Warning一下或者在文档里说明

cesaryuan avatar Jul 10 '22 11:07 cesaryuan