Gu5.Framework.Core
1.0.5
Suggested Alternatives
dotnet add package Gu5.Framework.Core --version 1.0.5
NuGet\Install-Package Gu5.Framework.Core -Version 1.0.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Gu5.Framework.Core" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Gu5.Framework.Core" Version="1.0.5" />
<PackageReference Include="Gu5.Framework.Core" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Gu5.Framework.Core --version 1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Gu5.Framework.Core, 1.0.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Gu5.Framework.Core@1.0.5
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Gu5.Framework.Core&version=1.0.5
#tool nuget:?package=Gu5.Framework.Core&version=1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Gu5.Net
.NET 通用工具库
安装与使用
dotnet add package Gu5.Net
// .NET 8
using Gu5.Net.Core
// .NET Framework 4.6.1
using Gu5.Framework.Core
功能列表
函数式编程
- Then / Else 条件执行
(value > 0)
.Then(() => Console.WriteLine("OK"))
.Else(() => Console.WriteLine("NG"));
- Also / With 条件赋值
var rs = new Object()
.Also(x => x.Init())
.Also(x => x.Validate());
var len = text.With(x => x.Length);
- Find / ForEach 集合操作扩展
- Sample 随机采样
- At / Range / Mod 安全索引
- GetDescription 枚举描述
时间序列
- RangeFrom 获取时间轴
var timeline = RangeFrom(start, end);
- Resample 重采样(Pandas
resample+last)
var dict = data.Resample(x => x.Timestamp);
- FFill Pandas
ffill
var values = dict.FFill(keys, lim: 3);
依赖注入
using Gu5.Framework.Core.DependencyInjection;
- AddImplOf 扫描注册所有实现
services.AddImplOf<IMyService>(
(services, serviceType, implType) =>
services.AddSingleton(serviceType, implType),
typeof(IMyService).Assembly
);
- AddSingletonOf / AddScopedOf / AddTransientOf 全局/实例/单次 生命周期
var asm = typeof(T).Assembly;
services.AddSingletonOf<T>(asm);
services.AddScopedOf<T>(asm);
services.AddTransientOf<T>(asm);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.6.1
- Microsoft.Extensions.DependencyInjection (>= 6.0.2)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
feat: Interval