EasilyNET.Core
2.2.71
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package EasilyNET.Core --version 2.2.71
NuGet\Install-Package EasilyNET.Core -Version 2.2.71
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="EasilyNET.Core" Version="2.2.71" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasilyNET.Core --version 2.2.71
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EasilyNET.Core, 2.2.71"
#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.
// Install EasilyNET.Core as a Cake Addin #addin nuget:?package=EasilyNET.Core&version=2.2.71 // Install EasilyNET.Core as a Cake Tool #tool nuget:?package=EasilyNET.Core&version=2.2.71
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EasilyNET.Core
业务类型库,用于一些业务方面的类,如分页,以及业务中常用的一些数据类型和枚举类型
以及大量的静态扩展函数
枚举类型:
名称 | 用途 |
---|---|
EGender | 性别 |
ENation | 中国民族 |
ETimeOverlap | 时间重合情况 |
EZodiac | 生肖 |
- 业务常用数据类型.
名称 | 用途 |
---|---|
IdNameItem | 包含 ID 和 Name 字段的基础类 |
OperationInfo | 操作信息,包含操作人以及时间和是否完成 |
Operator | 操作人,包含 rid 和名称字段 |
ReferenceItem | 通常用来保存关联的业务信息,如 ID 和名称或者其他相关数据 |
- 其他的还有分页信息等.
ChangeLog:
- 新增基于表达式树和 Reflection 的 DeepCopy, BigNumber
- 添加异步锁
- 新增雪花 ID 算法.以及一些扩展方法.
- 新增 Ini 文件帮助类.
- 一些基础库,如数据类型,一些公共静态方法,工具函数.包含数组,日期,字符串,中国农历,拼音,身份证验证等功能
- 将 EasilyNET.Extensions 库合并到 Core 中.
- 新增百度坐标(BD09)、国测局坐标(火星坐标,GCJ02)、和 WGS84 坐标系之间的转换
新增 C# 语法糖
- 正常写法
int[] array = [1, 2, 3];
foreach (var i in array)
{
Console.WriteLine(i);
}
OutPut: 1,2,3
- 新增的语法糖
foreach (var i in ..3)
{
Console.WriteLine(i);
}
OutPut: 0,1,2,3
foreach (var i in 1..3)
{
Console.WriteLine(i);
}
OutPut: 1,2,3
ZIP 压缩
- CompressionHelper 和 ZipHelper,CompressionHelper 用于压缩/解压 字节数组,ZipHelper 用于文件和文件夹的压缩和解压
当前互联网地图的坐标系现状
地球坐标(WGS84)
- 国际标准,从 GPS 设备中取出的数据的坐标系
- 国际地图提供商使用的坐标系
火星坐标(GCJ-02)也叫国测局坐标系
- 中国标准,从国行移动设备中定位获取的坐标数据使用这个坐标系
- 国家规定: 国内出版的各种地图系统(包括电子形式),必须至少采用 GCJ-02 对地理位置进行首次加密.
百度坐标(BD-09)
- 百度标准,百度 SDK,百度地图,GeoCoding 使用 -(本来就乱了,百度又在火星坐标上来个二次加密)
开发过程需要注意的事
从设备获取经纬度(GPS)坐标
如果使用的是百度 sdk 那么可以获得百度坐标(bd09)或者火星坐标(GCJ02),默认是 bd09 如果使用的是 ios 的原生定位库,那么获得的坐标是 WGS84 如果使用的是高德 sdk,那么获取的坐标是 GCJ02
互联网在线地图使用的坐标系
火星坐标系:
iOS 地图(其实是高德) Google 国内地图(.cn 域名下) 搜搜、阿里云、高德地图、腾讯百度坐标系: 当然只有百度地图 WGS84 坐标系: 国际标准,谷歌国外地图、osm 地图等国外的地图一般都是这个
// 测试经纬度问题
CoordinateConvert.BD09ToGCJ02(116.404, 39.915, out var gcjLon, out var gcjLat);
CoordinateConvert.GCJ02ToBD09(116.404, 39.915, out var bdLon, out var bdLat);
CoordinateConvert.WGS84ToGCJ02(116.404, 39.915, out var gcjLon2, out var gcjLat2);
CoordinateConvert.GCJ02ToWGS84(116.404, 39.915, out var wgsLon, out var wgsLat);
Console.WriteLine($"百度经纬度坐标转国测局坐标,经度:{gcjLon},纬度:{gcjLat}");
Console.WriteLine($"国测局坐标转百度经纬度坐标,经度:{bdLon},纬度:{bdLat}");
Console.WriteLine($"WGS84转国测局坐标,经度:{gcjLon2},纬度:{gcjLat2}");
Console.WriteLine($"国测局坐标转WGS84坐标,经度:{wgsLon},纬度:{wgsLat}");
// 百度经纬度坐标转国测局坐标,经度:116.39762729119315,纬度:39.90865673957631
// 国测局坐标转百度经纬度坐标,经度:116.41036949371029,纬度:39.92133699351021
// WGS84转国测局坐标,经度:116.41024449916938,纬度:39.91601738120746
// 国测局坐标转WGS84坐标,经度:116.39775550083061,纬度:39.91398261879254
身份证校验以及通过身份证号码获取生日,年龄,以及性别
var check = "52305199405088125".CheckIDCard(); // true or false
var birthday = "52305199405088125".CalculateBirthday(); // DateOnly
var gender = "52305199405088125".CalculateGender(); // EGender
var age = "52305199405088125".CalculateAge(); // Int32
雪花 ID 算法
// 基于 MongoDB 的 ObjectId,产生24位长度16进制字符串,
// 可以与 MongoDB 的 ObjectID 互转.
var snow = SnowId.GenerateNewId();
雪花算法,支持 Long 类型
var id = SnowFlakeId.Default.NextId(); 方便使用
也可以
var snowFlake=new SnowFlakeId(1,0l);
var nextId =snowFlake.NextId();
设置不一样的workerId
const int workerId = 123;
SnowFlakeId.SetDefaultSnowFlakeId(new(workerId));
var id = SnowFlakeId.Default.NextId();
DeepCopy
class Person
{
public string Name { get; set; } = "张三";
}
var person= new Person();
var person2 = person.DeepCopy();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Microsoft.Extensions.DependencyModel (>= 8.0.0)
-
net9.0
- Microsoft.Extensions.DependencyModel (>= 9.0.0-preview.3.24172.9)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on EasilyNET.Core:
Package | Downloads |
---|---|
EasilyNET.RabbitBus.Core
抽离一些EasilyNET.RabbitBus到Core库,便于消息事件实体复用. |
|
EasilyNET.WebCore
包含Swagger的一些扩展的WebCore扩展 |
|
EasilyNET.AutoDependencyInjection
类似于ABP框架的自动模块注入,独立出来单独维护. |
|
EasilyNET.EntityFrameworkCore
EntityFrameworkCore |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.24.924.10 | 0 | 9/23/2024 |
3.24.924.1 | 0 | 9/23/2024 |
3.24.923.234 | 0 | 9/23/2024 |
3.24.923.232 | 0 | 9/23/2024 |
3.24.923.155 | 20 | 9/23/2024 |
3.24.919.92 | 46 | 9/19/2024 |
3.24.914.125 | 218 | 9/14/2024 |
3.24.914.115 | 55 | 9/14/2024 |
3.24.914.111 | 54 | 9/14/2024 |
3.24.911.95 | 114 | 9/11/2024 |
3.24.908.215 | 61 | 9/8/2024 |
3.24.904.200 | 69 | 9/4/2024 |
3.24.828.163 | 93 | 8/28/2024 |
3.24.820.173 | 82 | 8/20/2024 |
3.24.814.92 | 86 | 8/14/2024 |
3.24.812.115 | 77 | 8/12/2024 |
3.24.802.100 | 50 | 8/2/2024 |
3.24.801.162 | 60 | 8/1/2024 |
3.24.801.160 | 50 | 8/1/2024 |
3.24.801.155 | 48 | 8/1/2024 |
3.24.801.153 | 39 | 8/1/2024 |
3.24.730.164 | 47 | 7/30/2024 |
3.24.730.91 | 42 | 7/30/2024 |
3.24.724.91 | 52 | 7/24/2024 |
3.24.718.105 | 68 | 7/18/2024 |
3.24.716.95 | 64 | 7/16/2024 |
3.24.712.94 | 65 | 7/12/2024 |
3.24.710.14 | 73 | 7/9/2024 |
3.24.709.105 | 70 | 7/9/2024 |
3.24.704.94 | 69 | 7/4/2024 |
3.24.701.90 | 75 | 7/1/2024 |
3.24.628.114 | 88 | 6/28/2024 |
3.24.627.145 | 69 | 6/27/2024 |
3.24.620.160 | 75 | 6/20/2024 |
3.24.613.115 | 68 | 6/13/2024 |
3.24.612.95 | 63 | 6/12/2024 |
3.24.528.90 | 72 | 5/28/2024 |
3.24.522.84 | 77 | 5/22/2024 |
3.24.512.213 | 65 | 5/12/2024 |
3.24.508.112 | 82 | 5/8/2024 |
2.2024.428.71 | 77 | 4/28/2024 |
2.2024.427.1128 | 85 | 4/27/2024 |
2.2.72 | 146 | 4/14/2024 |
2.2.71 | 76 | 4/12/2024 |
2.2.8 | 66 | 4/26/2024 |
2.2.6 | 76 | 4/10/2024 |
2.2.5 | 104 | 3/26/2024 |
2.2.4 | 107 | 3/25/2024 |
2.2.3 | 103 | 3/24/2024 |
2.2.2 | 106 | 3/21/2024 |
2.2.1 | 98 | 3/20/2024 |
2.2.0 | 108 | 3/13/2024 |
2.1.9 | 134 | 2/21/2024 |
2.1.8 | 117 | 2/18/2024 |
2.1.7 | 121 | 2/16/2024 |
2.1.6 | 165 | 2/14/2024 |
2.1.5 | 115 | 2/14/2024 |
2.1.4 | 261 | 2/9/2024 |
2.1.3 | 265 | 2/8/2024 |
2.1.2 | 307 | 2/5/2024 |
2.1.1.2 | 428 | 12/26/2023 |
2.1.1.1 | 306 | 12/26/2023 |
2.1.1 | 352 | 12/25/2023 |
2.1.0 | 398 | 12/17/2023 |
2.0.11 | 438 | 12/6/2023 |
2.0.1 | 435 | 11/15/2023 |
2.0.0 | 371 | 11/14/2023 |
1.9.1 | 334 | 11/1/2023 |
1.9.0 | 321 | 10/19/2023 |
1.9.0-preview2 | 479 | 10/12/2023 |
1.9.0-preview1 | 284 | 10/12/2023 |
1.8.9 | 350 | 10/11/2023 |
1.8.8 | 349 | 10/11/2023 |
1.8.7-rc2 | 322 | 9/21/2023 |
1.8.7-rc1 | 299 | 9/12/2023 |
1.8.6 | 356 | 8/31/2023 |
1.8.5 | 963 | 8/25/2023 |
1.8.4 | 371 | 8/24/2023 |
1.8.3 | 349 | 8/23/2023 |
1.8.2 | 480 | 8/22/2023 |
1.8.1 | 407 | 8/18/2023 |
1.8.0 | 403 | 8/15/2023 |
1.7.9 | 449 | 8/11/2023 |
1.7.8 | 391 | 8/11/2023 |
1.7.7 | 428 | 8/10/2023 |
1.7.6 | 403 | 8/9/2023 |
1.7.5 | 469 | 8/9/2023 |
1.7.4 | 522 | 8/3/2023 |
1.7.3 | 445 | 8/1/2023 |
1.7.2 | 418 | 7/31/2023 |
1.7.1 | 403 | 7/27/2023 |
1.7.0 | 426 | 7/25/2023 |
1.6.9 | 418 | 7/25/2023 |
1.6.8 | 408 | 7/24/2023 |
1.6.7 | 441 | 7/20/2023 |
1.6.6 | 428 | 7/19/2023 |
1.6.5 | 405 | 7/19/2023 |
1.6.4 | 422 | 7/17/2023 |
1.6.3 | 399 | 7/17/2023 |
1.6.2 | 468 | 7/12/2023 |
1.6.1 | 494 | 6/30/2023 |
1.6.0 | 417 | 6/26/2023 |
1.5.9 | 432 | 6/22/2023 |
1.5.8 | 463 | 6/15/2023 |
1.5.7.1 | 443 | 6/14/2023 |
1.5.7 | 468 | 6/14/2023 |
1.5.6.2 | 513 | 6/7/2023 |
1.5.6.1 | 441 | 6/7/2023 |
1.5.6 | 443 | 6/7/2023 |
1.5.5.2 | 501 | 5/26/2023 |
1.5.5.1 | 483 | 5/26/2023 |
1.5.5 | 483 | 5/26/2023 |
1.5.4.4 | 465 | 5/25/2023 |
1.5.4.3 | 504 | 5/23/2023 |
1.5.4.2 | 572 | 5/17/2023 |
1.5.4.1 | 458 | 5/16/2023 |
1.5.4 | 567 | 5/11/2023 |
1.5.3 | 500 | 5/11/2023 |
1.5.2 | 472 | 5/10/2023 |
1.5.1 | 449 | 5/10/2023 |
1.5.0 | 482 | 5/6/2023 |
1.4.0 | 186 | 5/5/2023 |
1.3.9 | 220 | 4/23/2023 |
1.3.8.6 | 140 | 4/23/2023 |
1.3.8.5 | 107 | 4/21/2023 |
1.3.8.1 | 178 | 4/12/2023 |
1.3.8 | 119 | 4/11/2023 |
1.3.8-pre | 84 | 4/11/2023 |
1.3.7 | 140 | 4/9/2023 |
1.3.6.3 | 179 | 4/1/2023 |
1.3.6.2 | 114 | 3/31/2023 |
1.3.6.1 | 106 | 3/31/2023 |
1.3.6 | 101 | 3/31/2023 |
1.3.5 | 106 | 3/30/2023 |
1.3.4.1 | 160 | 3/29/2023 |
1.3.4 | 120 | 3/28/2023 |
1.3.3 | 95 | 3/28/2023 |
1.3.2 | 128 | 3/26/2023 |
1.3.1 | 174 | 3/22/2023 |
1.3.0 | 129 | 3/21/2023 |
1.2.0 | 106 | 3/21/2023 |
1.1.0 | 232 | 3/17/2023 |
1.0.9 | 244 | 3/15/2023 |
1.0.8 | 233 | 3/15/2023 |
1.0.7 | 236 | 3/15/2023 |
1.0.6 | 253 | 3/13/2023 |
1.0.5 | 237 | 3/13/2023 |
1.0.4 | 237 | 3/13/2023 |
1.0.2 | 278 | 2/28/2023 |
1.0.1 | 279 | 2/23/2023 |
1.0.0 | 522 | 2/20/2023 |