Qowaiv / qowaiv-analyzers

Roslyn Analyzers
MIT License
1 stars 1 forks source link

New Rule: Use System.DateOnly instead of Qowaiv.Date #29

Closed Corniel closed 9 months ago

Corniel commented 9 months ago

The purpose of Qowaiv.Date is to provide a date (only) alternative to System.DateTime. Since .NET 6.0, however Microsoft (finally) provides a date only implementation: System.DateOnly. Therefor, the usage of Qowaiv.Date is not longer of added value when .NET 6.0 or higher is used.

Non-compliant

class SomeClass
{
    public Date Value { get; }
}

record SomeRecord(Date Value);

Compliant

class SomeClass
{
    public DateOnly Value { get; }
}

record SomeRecord(DateOnly Value);