How can I save a collection of CultureInfo type using EF Core without adding backing fields?
In a class, I have a collection of type List<CultureInfo> OfficialLanguages. I need to respect domain driven design for this project. I cannot add a backing field of type List<string> officialLanguagesCodes and handle it that way.
When I have a single property like User.Culture, I can handle a conversion like this in my OnModelCreating:
modelBuilder.Entity<User>().Property(u => u.Culture).HasConversion(c => c.Name, s => new(s));
How can I achieve something similar for a collection?
1 answer
Sort by: Most helpful
-
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more