mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 修复 LazyLoading 在 Net4 环境下的问题;
This commit is contained in:
1
Examples/base_entity/Entities/Class1.cs
Normal file
1
Examples/base_entity/Entities/Class1.cs
Normal file
@ -0,0 +1 @@
|
||||
|
@ -31,7 +31,7 @@ public class User1 : BaseEntity<User1, Guid>
|
||||
public int GroupId { get; set; }
|
||||
public UserGroup Group { get; set; }
|
||||
|
||||
public List<Role> Roles { get; set; }
|
||||
public virtual List<Role> Roles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 登陆名
|
||||
|
@ -44,10 +44,13 @@ namespace base_entity
|
||||
.UseConnectionString(FreeSql.DataType.Sqlite, "data source=test.db;max pool size=5")
|
||||
//.UseConnectionString(FreeSql.DataType.MySql, "Data Source=127.0.0.1;Port=3306;User ID=root;Password=root;Initial Catalog=cccddd;Charset=utf8;SslMode=none;Max pool size=2")
|
||||
.UseConnectionString(FreeSql.DataType.SqlServer, "Data Source=.;Integrated Security=True;Initial Catalog=freesqlTest;Pooling=true;Max Pool Size=3")
|
||||
.UseLazyLoading(true)
|
||||
.Build();
|
||||
BaseEntity.Initialization(fsql);
|
||||
#endregion
|
||||
|
||||
var us = User1.Select.Limit(10).ToList();
|
||||
|
||||
new Products { title = "product-1" }.Save();
|
||||
new Products { title = "product-2" }.Save();
|
||||
new Products { title = "product-3" }.Save();
|
||||
|
@ -17,6 +17,7 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Extensions\FreeSql.Extensions.BaseEntity\FreeSql.Extensions.BaseEntity.csproj" />
|
||||
<ProjectReference Include="..\..\Extensions\FreeSql.Extensions.JsonMap\FreeSql.Extensions.JsonMap.csproj" />
|
||||
<ProjectReference Include="..\..\Extensions\FreeSql.Extensions.LazyLoading\FreeSql.Extensions.LazyLoading.csproj" />
|
||||
<ProjectReference Include="..\..\FreeSql.Repository\FreeSql.Repository.csproj" />
|
||||
<ProjectReference Include="..\..\FreeSql\FreeSql.csproj" />
|
||||
<ProjectReference Include="..\..\Providers\FreeSql.Provider.MySql\FreeSql.Provider.MySql.csproj" />
|
||||
|
@ -35,13 +35,6 @@ namespace orm_vs
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var testlist1 = fsql.Select<Song>().OrderBy(a => a.Id).ToList();
|
||||
var testlist2 = new List<Song>();
|
||||
fsql.Select<Song>().OrderBy(a => a.Id).ToChunk(0, list =>
|
||||
{
|
||||
testlist2.AddRange(list);
|
||||
});
|
||||
|
||||
fsql.CodeFirst.SyncStructure(typeof(Song), typeof(Song_tag), typeof(Tag));
|
||||
//sugar.CodeFirst.InitTables(typeof(Song), typeof(Song_tag), typeof(Tag));
|
||||
//sugar创建表失败:SqlSugar.SqlSugarException: Sequence contains no elements
|
||||
|
Reference in New Issue
Block a user