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
@@ -86,6 +85,17 @@ Create a new partial class that inherits from `JsonSerializerContext`. It shoul
86
85
{
87
86
}
88
87
88
+
Enumerations (enum) are transmitted as strings. If you use an enum in any of your models, you will additionally have to add `typeof(JsonStringEnumConverter<TEnum>)` to the list of converters, where `TEnum` is the type of the enum you are using. Repeat this for each enum you are using. For example, let's say you have multiple models. One of your models is using the enum `CategoryType` and another model is using `CustomerType`, your Converters section would look like this:
89
+
90
+
Converters = [
91
+
typeof(JsonStringEnumConverter<CategoryType>)
92
+
typeof(JsonStringEnumConverter<CustomerType>)
93
+
typeof(DateTimeConverter),
94
+
typeof(DateTimeOffsetConverter),
95
+
typeof(TimeOnlyConverter),
96
+
typeof(SpatialGeoJsonConverter)
97
+
]
98
+
89
99
Add a `JsonSerializable` attribute for each entity that is stored in your `DbContext` similar to the ones in the example above. Finally, install the modified `JsonSerializerContext` in the `MauiProgram.cs` as the second statment in the `CreateMauiApp` function:
@@ -105,5 +115,4 @@ The property group should look something like the following:
105
115
106
116
## Having problems?
107
117
108
-
Unfortunately, the development team does not have much experience with releasing iOS applications, so is of limited help. While you can [add a discussion](https://github.com/CommunityToolkit/Datasync/discussions), you will probably get more assistance in the [MAUI](https://github.com/dotnet/maui) and [Entity Framework Core](https://github.com/dotnet/efcore) projects.
109
-
118
+
Unfortunately, the development team does not have much experience with releasing with Native AOT, so is of limited help. While you can [add a discussion](https://github.com/CommunityToolkit/Datasync/discussions), you will probably get more assistance in the [MAUI](https://github.com/dotnet/maui) and [Entity Framework Core](https://github.com/dotnet/efcore) projects.
0 commit comments