From c7245015de2a10e0f4a28e37ab01801628d088d7 Mon Sep 17 00:00:00 2001 From: Hamza Albreem <94292623+braim23@users.noreply.github.com> Date: Tue, 31 Oct 2023 10:33:26 +0300 Subject: [PATCH] Update POST.md --- .../POST.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/en/Community-Articles/2023-10-28-EF-Core-8-Primitive-Collections/POST.md b/docs/en/Community-Articles/2023-10-28-EF-Core-8-Primitive-Collections/POST.md index 6d5d7cdea9..79d1b100c9 100644 --- a/docs/en/Community-Articles/2023-10-28-EF-Core-8-Primitive-Collections/POST.md +++ b/docs/en/Community-Articles/2023-10-28-EF-Core-8-Primitive-Collections/POST.md @@ -5,11 +5,11 @@ What can we do when we want to store a list of primitive types? Before EF Core 8 - Create a wrapper class and a related table, then add a foreign key linking each value to its owner of the collection. - Use [value converter](https://learn.microsoft.com/en-us/ef/core/modeling/value-conversions) to serialize-deserialize as JSON. -The first option covers most scenarios if we need to add some additional properties to this type but let's say we never gonna need this type additionality. +The first option covers most scenarios if we need to add some additional properties to this type but let's say we're never gonna need this type additionality. -## Which collection types supported ? +## Which collection types are supported ? -EF Core has the capability to map `IEnumerable` public properties that have both a getter and a setter, with `T` representing a primitive type +EF Core has the capability to map the `IEnumerable` public properties that have both a getter and a setter, with the `T` representing a primitive type ```csharp public class PrimitiveCollections @@ -54,7 +54,7 @@ public class Car } ``` -When we want to list cars if they have any of the specific colors. +When we want to list the cars if they have any of the specific colors. ```csharp var colors = new HashSet { Color.Blue, Color.White }; @@ -81,7 +81,7 @@ SELECT "c"."Id", "c"."Brand", "c"."Colors", "c"."Model" ``` -When we insert to car table. +When we insert to the car table. ```csharp var car = new Car("Maserati", "GranTurismo") @@ -110,9 +110,9 @@ The SQL statement looks like this, and as you can see, it automatically serializ ``` ## Conclusion -We don't need to do anything if we just use a collection of primitive types. It serializes and deserializes as JSON automatically. Additionally, it sends the primitive collection as a parameter to cache the query. +We don't need to do anything if we just use a collection of primitive types. It serializes and deserializes them as JSON automatically. Additionally, it sends the primitive collection as a parameter to cache the query. ## References - [EF Core 8 Primitive collections](https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-8.0/whatsnew#primitive-collection-properties) -- [.NET Data Community Standup - Collections of primitive values in EF Core](https://www.youtube.com/watch?v=AUS2OZjsA2I) \ No newline at end of file +- [.NET Data Community Standup - Collections of primitive values in EF Core](https://www.youtube.com/watch?v=AUS2OZjsA2I)