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
In addition to the natively supported primitive types, any other types that implement `IParsable<T>`
92
+
and `IFormattable` get automatic support by persisting as strings. This means that you can,
93
+
for example, use [Ulid](https://github.com/Cysharp/Ulid) out of the box without any further
94
+
configuration or customization (since it implements both interfaces).
95
+
96
+
Additionally, the `UseStructId` will pick up any custom [ValueConverter<TModel,TProvider>](https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.storage.valueconversion.valueconverter-2?view=efcore-9.0)
97
+
you may add to your project and register them too for convenience.
98
+
91
99
## Dapper
92
100
93
101
If you are using Dapper, the package will automatically generate required `SqlMapper.TypeHandler<T>`
@@ -107,6 +115,29 @@ as strings). This means that you can, for example, use [Ulid](https://github.com
107
115
out of the box without any further configuration or customization (since it implements
108
116
both interfaces).
109
117
118
+
Additionally, the `UseStructId` will pick up any custom `Dapper.SqlMapper.TypeHandler<T>`
119
+
you may add to your project and register them too for convenience.
120
+
121
+
## Ulid
122
+
123
+
Since [Ulid](https://github.com/Cysharp/Ulid) implements `IParsable<T>` and `IFormattable`,
124
+
it is supported out of the box without any further configuration or customization with both
125
+
Dapper and EF Core.
126
+
127
+
In addition to the necessary converter/handler registration, the package will also generate
128
+
a `New()` (parameterless) factory method for struct ids using `Ulid` as the value type, which
129
+
in turn will use `Ulid.NewUlid()` to generate a new value. This mirrors the behavior
0 commit comments