osu-tournament-rating / otr-api

API powering osu! Tournament Rating
https://otr.stagec.xyz/
GNU General Public License v3.0
4 stars 2 forks source link

Use AutoMapper attribute mappings for simplified mapping configurations #224

Closed myssto closed 1 month ago

myssto commented 3 months ago

AutoMapper includes a AutoMapAttribute that can be used to decorate classes that are to be mapped from another. This attribute functions near identically to CreateMap<TSrc, TDst> inside of a MapperProfile. There are a few caveats like being unable to use the .MapAfter() method (seen in #223), so keeping our current profile is fine for those instances. Outside of that, we can clean up most if not all of the current maps using this attribute.

See AutoMapper Attribute Mapping

myssto commented 3 months ago

Implementation of this is in refactor/attribute-mapping.

Depends on #223, will PR after merge

myssto commented 1 month ago

Feels like a non-issue to me now, no real need for this currently. Maybe in the future if we decide to have more history entities then it would make sense