From 39ac2d8286b93646f95dfa9280322ce7b49ac832 Mon Sep 17 00:00:00 2001 From: AlexLEWIS Date: Wed, 11 Aug 2021 13:38:06 +0800 Subject: [PATCH] Add English comments for JsonMap extension package. --- .../DataAnnotations/JsonMapAttribute.cs | 12 +++++------- Extensions/FreeSql.Extensions.JsonMap/JsonMapCore.cs | 11 +++++------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Extensions/FreeSql.Extensions.JsonMap/DataAnnotations/JsonMapAttribute.cs b/Extensions/FreeSql.Extensions.JsonMap/DataAnnotations/JsonMapAttribute.cs index 44f5d8a1..77878720 100644 --- a/Extensions/FreeSql.Extensions.JsonMap/DataAnnotations/JsonMapAttribute.cs +++ b/Extensions/FreeSql.Extensions.JsonMap/DataAnnotations/JsonMapAttribute.cs @@ -1,13 +1,11 @@ using System; -using System.Linq; +// ReSharper disable once CheckNamespace namespace FreeSql.DataAnnotations { - /// - /// 当实体类属性为【对象】时,以JSON形式映射存储 + /// When the entity class property is , map storage in JSON format.
+ /// 当实体类属性为【对象】时,以 JSON 形式映射存储 ///
- public class JsonMapAttribute : Attribute - { - } -} + public class JsonMapAttribute : Attribute { } +} \ No newline at end of file diff --git a/Extensions/FreeSql.Extensions.JsonMap/JsonMapCore.cs b/Extensions/FreeSql.Extensions.JsonMap/JsonMapCore.cs index 42c61462..60b0e0b1 100644 --- a/Extensions/FreeSql.Extensions.JsonMap/JsonMapCore.cs +++ b/Extensions/FreeSql.Extensions.JsonMap/JsonMapCore.cs @@ -5,7 +5,6 @@ using System.Collections.Concurrent; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using System.Text; using System.Threading; public static class FreeSqlJsonMapCoreExtensions @@ -19,11 +18,12 @@ public static class FreeSqlJsonMapCoreExtensions public static ColumnFluent JsonMap(this ColumnFluent col) { _dicJsonMapFluentApi.GetOrAdd(col._entityType, et => new ConcurrentDictionary()) - .GetOrAdd(col._property.Name, pn => true); + .GetOrAdd(col._property.Name, pn => true); return col; } /// + /// When the entity class property is and the attribute is marked as , map storage in JSON format.
/// 当实体类属性为【对象】时,并且标记特性 [JsonMap] 时,该属性将以JSON形式映射存储 ///
/// @@ -43,7 +43,7 @@ public static class FreeSqlJsonMapCoreExtensions }); } - that.Aop.ConfigEntityProperty += new EventHandler((s, e) => + that.Aop.ConfigEntityProperty += (s, e) => { var isJsonMap = e.Property.GetCustomAttributes(typeof(JsonMapAttribute), false).Any() || _dicJsonMapFluentApi.TryGetValue(e.EntityType, out var tryjmfu) && tryjmfu.ContainsKey(e.Property.Name); if (isJsonMap) @@ -61,7 +61,6 @@ public static class FreeSqlJsonMapCoreExtensions }); } } - }); + }; } -} - +} \ No newline at end of file