mikependon / RepoDB

A hybrid ORM library for .NET.
Apache License 2.0
1.68k stars 122 forks source link

Generic Attribute for ClassHandler #1169

Closed SergerGood closed 5 months ago

SergerGood commented 5 months ago

How about using generic attributes. For example for a ClassHandlerAttribute.

Then instead of:

[ClassHandler(typeof(PersonClassHandler))]
public class Person
{
    public long Id { get; set; }
    public string Name { get; set; }
}

we can use:

[ClassHandler<PersonClassHandler>]
public class Person
{
    public long Id { get; set; }
    public string Name { get; set; }
}

The only limitation is that this feature is only available for net 7 or greate.