You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suggest to add an additional project (StronglyTypedId.Interfaces) with
publicinterfaceIId<TBacking>{TBackingValue{get;}}
and probably with
publicinterfaceIId<TId,TBacking>whereTId:IId<TId,TBacking>{staticabstract TId New();// Parse/TryParse}
IId interfaces will drammatically help us to minimize boilerplate code:
Ids are stored in redis (and in rdbms via dapper) and we write the same (de)serialization code again and again, shared Parse/TryParse will help here
We configure swagger to treat ids as guids and we have to explicitely enumerate all ids during configuration. With IId in place it will be possible to enumerate all ids via reflection.
We store ids in separate libraries with contracts and we do not to pollute ids with additional attributes or add swagger/dapper packages to contract libraries.
The text was updated successfully, but these errors were encountered:
I'm on board with the interface as an optional extra (though I think you could do this now relatively easily?) but I'm not sure about the extra project 🤔 If you need the interface to be in a separate project from the IDs then I think your best bet is to write those yourselves, and then just add them to your ID definitions e.g.
I suggest to add an additional project (
StronglyTypedId.Interfaces
) withand probably with
IId
interfaces will drammatically help us to minimize boilerplate code:IId
in place it will be possible to enumerate all ids via reflection.We store ids in separate libraries with contracts and we do not to pollute ids with additional attributes or add swagger/dapper packages to contract libraries.
The text was updated successfully, but these errors were encountered: