Skip to content

ufcpp/RemoveOnly

Repository files navigation

RemoveOnly

This package removes "Only" from DateOnly/TimeOnly, which are new structs added in .NET 6.

Date and Time

See: Date, Time, and Time Zone Enhancements in .NET 6 - Why are they named “Only”?

How to use

https://www.nuget.org/packages/RemoveOnly/

NuGet

How this works

  • This NuGet package contains a Roslyn source generator
  • It generates a following C# code in PostInitialization
// <auto-generated />
#if NET6_0_OR_GREATER
global using Date = System.DateOnly;
global using Time = System.TimeOnly;
#endif
  • Global using directives have project-wide effects
  • All of projects dependent on this package transitively are affected, because NuGet dependency resolution is transitive and this package does not specify PrivateAssets property

About

Removes "Only" from DateOnly/TimeOnly structs.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages