that's fairly easy, you just need a class like this:[JsonSerializable(typeof(Foo))]
[JsonSerializable(typeof(Bar))]
public partial class FooContext : JsonSerializerContext;
(btw in C# you can write empty classes like this, without { }
)
then when calling JsonSerializer manually you just need to use the overload that lets you pass the context for the type you want (e.g. JsonSerializer.Deserialize<Foo>(rawString, FooContext.Default.Foo)
)
you can also set the context itself as JsonSerializerOptions.TypeInfoResolver
or add it to JsonSerializerOptions.TypeInfoResolverChain
if you have more than one - both lets you use it with asp.net (only minimal API) by setting the global json options in DI
sorry Levi, it was probably a false positive
were you asking for the correct way to write .net?
Group rules
Job offers/search/proxy = warn/ban
Job/Interview support = warn/ban
Spam/ads = warn/ban
Piracy/porn/gore = guess what? ban!
Keep discussions on topic and in English.
We won't do your homework/exams for you!
➡️ Post job ads in @dot_jobs
I want to change relationship structure, but getting error. These are just test tables so I can just reset or remove them. What is the best way in this case to create situation as if I create migration from scratch?
Читать полностью…Once dataset is initialized in this code, FillDataSet(ds) is UDF where dataset will be filled with the help of dataAdapter and then return the dataset which further you'll use as a data source to display the data in your app.
Читать полностью…No course in the world, even the best one will help you if you don't have the desire and burn inside you to sit and learn
Читать полностью…I request another resource, afterward backend redirect me to login action because it think that I unauthorized
Читать полностью…Hello, please tell me what could be the issue: I've configured React and ASP.NET Core Web API to use JWT tokens, but for some reason, when React requests resources with the [Authorize] attribute, it gets denied, even though the header seems to be configured correctly. Here are snippets of the code, and if you need anything else, I'll provide it - https://gist.github.com/1lchenko/31ae204346d1249171d2631f10b88846.
Читать полностью…@deepakblr [1259130885
] warned (2 of 2).
• Due to: no ads or job posts
• Action: Muted 🔇
Can you suggest me how to create a gridview of bill as I keep adding an item from my stock using asp.net
Читать полностью…404 not found, means ur calling wrong endpoint. Please check url it might have some spell mistake.
Читать полностью…Bit off topic
But
Does anyone have practice material for the GIA (General Intelligence Assessment) and PPA(Personal Profile Analysis) tests material by Thomas International?