Skip to content
New issue

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

Dev #481

Merged
merged 2 commits into from
Jul 4, 2024
Merged

Dev #481

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions EasilyNET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApi.Test.Unit", "sample\
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{771BAFD8-69AB-4F2E-9FBF-0280E83953BF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LiteDB", "LiteDB", "{9E0F32B2-D021-4321-9426-81D00458EA70}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasilyNET.LiteDB.Core", "src\EasilyNET.LiteDB.Core\EasilyNET.LiteDB.Core.csproj", "{1392E8DC-3F8A-43AD-9AC8-DE9B6A3A0542}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -147,10 +143,6 @@ Global
{771BAFD8-69AB-4F2E-9FBF-0280E83953BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{771BAFD8-69AB-4F2E-9FBF-0280E83953BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{771BAFD8-69AB-4F2E-9FBF-0280E83953BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1392E8DC-3F8A-43AD-9AC8-DE9B6A3A0542}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1392E8DC-3F8A-43AD-9AC8-DE9B6A3A0542}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1392E8DC-3F8A-43AD-9AC8-DE9B6A3A0542}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1392E8DC-3F8A-43AD-9AC8-DE9B6A3A0542}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -176,8 +168,6 @@ Global
{7E493CA2-CB0C-77E0-B442-5ED204493F13} = {8D626EA8-CB54-BC41-363A-217881BEBA6E}
{8F9C18F9-A526-DCA0-597F-90D64AE5C6C2} = {8D626EA8-CB54-BC41-363A-217881BEBA6E}
{9B426136-DC85-603B-94FB-F3C0B2E72713} = {4F9DEAE5-078F-E77A-2E4A-FEB6FFE226FF}
{9E0F32B2-D021-4321-9426-81D00458EA70} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{1392E8DC-3F8A-43AD-9AC8-DE9B6A3A0542} = {9E0F32B2-D021-4321-9426-81D00458EA70}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BF2C0069-ED43-44A1-A66C-2CC1B62E3EA3}
Expand Down
1 change: 0 additions & 1 deletion src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.4.0" />
<PackageVersion Include="LiteDB" Version="5.0.20" />
<PackageVersion Include="MessagePack" Version="3.0.54-alpha" />
<PackageVersion Include="MongoDB.Bson" Version="2.27.0" />
<PackageVersion Include="MongoDB.Driver" Version="2.27.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private IReadOnlyList<IAppModule> LoadModules
/// <summary>
/// IServiceProvider?
/// </summary>
public IServiceProvider? ServiceProvider { get; private set; }
public IServiceProvider? ServiceProvider { get; set; }

/// <summary>
/// 模块接口容器
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ internal StartupModuleRunner(Type startupModuleType, IServiceCollection services
/// </summary>
private void ConfigureServices()
{
if (ServiceProvider is null)
{
SetServiceProvider(Services.BuildServiceProvider());
}
if (ServiceProvider is null) SetServiceProvider(Services.BuildServiceProvider());
var context = new ConfigureServicesContext(Services, ServiceProvider);
Services.AddSingleton(context);
foreach (var config in Modules)
Expand Down
10 changes: 9 additions & 1 deletion src/EasilyNET.Core/Language/CustomIntEnumeratorExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,20 @@ public static class CustomIntEnumeratorExtension
/// }
/// OutPut:
/// 1,2,3
/// foreach (var i in 3)
/// {
/// Console.WriteLine(i);
/// }
/// OutPut:
/// 0,1,2,3
/// ]]>
/// </code>
/// </example>
public struct CustomIntEnumerator
{
// public ref struct CustomIntEnumerator,其中ref标识符是否有必要?
// public ref struct CustomIntEnumerator
// ref struct的设计是为了限制该结构体只能堆栈上分配,
// 不能在托管堆上分配.这通常用于高性能的场景,以减少垃圾回收的压力.
private readonly int _end;

/// <summary>
Expand Down
22 changes: 0 additions & 22 deletions src/EasilyNET.LiteDB.Core/EasilyNET.LiteDB.Core.csproj

This file was deleted.

53 changes: 0 additions & 53 deletions src/EasilyNET.LiteDB.Core/LiteDbContext.cs

This file was deleted.

4 changes: 0 additions & 4 deletions src/EasilyNET.LiteDB.Core/README.md

This file was deleted.

17 changes: 15 additions & 2 deletions test/EasilyNET.Test.Unit/Language/CustomIntEnumeratorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public void TestCustomIntEnumeratorExtension(int value)
{
foreach (var i in ..value)
{
Console.WriteLine(i.ToString());
Console.WriteLine(i);
}
}

Expand All @@ -29,7 +29,20 @@ public void OneToValue(int value)
{
foreach (var i in 1..value)
{
Console.WriteLine(i.ToString());
Console.WriteLine(i);
}
}

/// <summary>
/// CustomIntEnumeratorExtension Test
/// </summary>
/// <param name="value"></param>
[TestMethod, DataRow(3), DataRow(5)]
public void OnlyValue(int value)
{
foreach (var i in value)
{
Console.WriteLine(i);
}
}
}