diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpMvcOptionsExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpMvcOptionsExtensions.cs index 9ff444001b..8cbba0fc46 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpMvcOptionsExtensions.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpMvcOptionsExtensions.cs @@ -59,7 +59,7 @@ namespace Volo.Abp.AspNetCore.Mvc private static void AddModelBinders(MvcOptions options) { options.ModelBinderProviders.Insert(0, new AbpDateTimeModelBinderProvider()); - options.ModelBinderProviders.Insert(0, new AbpExtraPropertiesDictionaryModelBinderProvider()); + options.ModelBinderProviders.Insert(1, new AbpExtraPropertiesDictionaryModelBinderProvider()); } private static void AddMetadataProviders(MvcOptions options, IServiceCollection services) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ModelBinding/AbpExtraPropertiesDictionaryModelBinderProvider.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ModelBinding/AbpExtraPropertiesDictionaryModelBinderProvider.cs index 812ca30f06..2aadddbb8b 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ModelBinding/AbpExtraPropertiesDictionaryModelBinderProvider.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ModelBinding/AbpExtraPropertiesDictionaryModelBinderProvider.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding.Binders; @@ -19,7 +18,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ModelBinding throw new ArgumentNullException(nameof(context)); } - if (context.Metadata.ModelType != typeof(Dictionary)) + if (context.Metadata.ModelType != typeof(ExtraPropertyDictionary)) { return null; } diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditLogActionInfo.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditLogActionInfo.cs index d1b3bcfff9..6813d372b0 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditLogActionInfo.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditLogActionInfo.cs @@ -17,11 +17,11 @@ namespace Volo.Abp.Auditing public int ExecutionDuration { get; set; } - public Dictionary ExtraProperties { get; } + public ExtraPropertyDictionary ExtraProperties { get; } public AuditLogActionInfo() { - ExtraProperties = new Dictionary(); + ExtraProperties = new ExtraPropertyDictionary(); } } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditLogInfo.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditLogInfo.cs index f780db924a..501e12d66c 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditLogInfo.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditLogInfo.cs @@ -47,7 +47,7 @@ namespace Volo.Abp.Auditing public List Exceptions { get; } - public Dictionary ExtraProperties { get; } + public ExtraPropertyDictionary ExtraProperties { get; } public List EntityChanges { get; } @@ -57,7 +57,7 @@ namespace Volo.Abp.Auditing { Actions = new List(); Exceptions = new List(); - ExtraProperties = new Dictionary(); + ExtraProperties = new ExtraPropertyDictionary(); EntityChanges = new List(); Comments = new List(); } @@ -107,4 +107,4 @@ namespace Volo.Abp.Auditing return sb.ToString(); } } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/EntityChangeInfo.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/EntityChangeInfo.cs index 5bf45f1375..7842d04f0e 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/EntityChangeInfo.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/EntityChangeInfo.cs @@ -25,13 +25,13 @@ namespace Volo.Abp.Auditing public List PropertyChanges { get; set; } - public Dictionary ExtraProperties { get; } + public ExtraPropertyDictionary ExtraProperties { get; } public virtual object EntityEntry { get; set; } //TODO: Try to remove since it breaks serializability public EntityChangeInfo() { - ExtraProperties = new Dictionary(); + ExtraProperties = new ExtraPropertyDictionary(); } public virtual void Merge(EntityChangeInfo changeInfo) diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/AggregateRoot.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/AggregateRoot.cs index 09af979e93..6d848b2dca 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/AggregateRoot.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/AggregateRoot.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using Volo.Abp.Auditing; using Volo.Abp.Data; @@ -13,7 +12,7 @@ namespace Volo.Abp.Domain.Entities IHasExtraProperties, IHasConcurrencyStamp { - public virtual Dictionary ExtraProperties { get; protected set; } + public virtual ExtraPropertyDictionary ExtraProperties { get; protected set; } [DisableAuditing] public virtual string ConcurrencyStamp { get; set; } @@ -21,7 +20,7 @@ namespace Volo.Abp.Domain.Entities protected AggregateRoot() { ConcurrencyStamp = Guid.NewGuid().ToString("N"); - ExtraProperties = new Dictionary(); + ExtraProperties = new ExtraPropertyDictionary(); this.SetDefaultsForExtraProperties(); } @@ -39,7 +38,7 @@ namespace Volo.Abp.Domain.Entities IHasExtraProperties, IHasConcurrencyStamp { - public virtual Dictionary ExtraProperties { get; protected set; } + public virtual ExtraPropertyDictionary ExtraProperties { get; protected set; } [DisableAuditing] public virtual string ConcurrencyStamp { get; set; } @@ -47,7 +46,7 @@ namespace Volo.Abp.Domain.Entities protected AggregateRoot() { ConcurrencyStamp = Guid.NewGuid().ToString("N"); - ExtraProperties = new Dictionary(); + ExtraProperties = new ExtraPropertyDictionary(); this.SetDefaultsForExtraProperties(); } @@ -55,7 +54,7 @@ namespace Volo.Abp.Domain.Entities : base(id) { ConcurrencyStamp = Guid.NewGuid().ToString("N"); - ExtraProperties = new Dictionary(); + ExtraProperties = new ExtraPropertyDictionary(); this.SetDefaultsForExtraProperties(); } diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/Modeling/AbpEntityTypeBuilderExtensions.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/Modeling/AbpEntityTypeBuilderExtensions.cs index 44962eca4c..a40c4d6254 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/Modeling/AbpEntityTypeBuilderExtensions.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/Modeling/AbpEntityTypeBuilderExtensions.cs @@ -60,10 +60,10 @@ namespace Volo.Abp.EntityFrameworkCore.Modeling return; } - b.Property>(nameof(IHasExtraProperties.ExtraProperties)) + b.Property(nameof(IHasExtraProperties.ExtraProperties)) .HasColumnName(nameof(IHasExtraProperties.ExtraProperties)) .HasConversion(new ExtraPropertiesValueConverter(b.Metadata.ClrType)) - .Metadata.SetValueComparer(new AbpDictionaryValueComparer()); + .Metadata.SetValueComparer(new ExtraPropertyDictionaryValueComparer()); b.TryConfigureObjectExtensions(); } diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueComparers/AbpDictionaryValueComparer.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueComparers/ExtraPropertyDictionaryValueComparer.cs similarity index 58% rename from framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueComparers/AbpDictionaryValueComparer.cs rename to framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueComparers/ExtraPropertyDictionaryValueComparer.cs index c6959b0801..01c2be346e 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueComparers/AbpDictionaryValueComparer.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueComparers/ExtraPropertyDictionaryValueComparer.cs @@ -1,17 +1,17 @@ using System; -using System.Collections.Generic; using System.Linq; using Microsoft.EntityFrameworkCore.ChangeTracking; +using Volo.Abp.Data; namespace Volo.Abp.EntityFrameworkCore.ValueComparers { - public class AbpDictionaryValueComparer : ValueComparer> + public class ExtraPropertyDictionaryValueComparer : ValueComparer { - public AbpDictionaryValueComparer() + public ExtraPropertyDictionaryValueComparer() : base( (d1, d2) => d1.SequenceEqual(d2), d => d.Aggregate(0, (k, v) => HashCode.Combine(k, v.GetHashCode())), - d => d.ToDictionary(k => k.Key, v => v.Value)) + d => new ExtraPropertyDictionary(d)) { } } diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs index 661da95a19..e2e1627bd1 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs @@ -2,12 +2,13 @@ using System.Collections.Generic; using System.Text.Json; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.Data; using Volo.Abp.Json.SystemTextJson.JsonConverters; using Volo.Abp.ObjectExtending; namespace Volo.Abp.EntityFrameworkCore.ValueConverters { - public class ExtraPropertiesValueConverter : ValueConverter, string> + public class ExtraPropertiesValueConverter : ValueConverter { public ExtraPropertiesValueConverter(Type entityType) : base( @@ -17,7 +18,7 @@ namespace Volo.Abp.EntityFrameworkCore.ValueConverters } - private static string SerializeObject(Dictionary extraProperties, Type entityType) + private static string SerializeObject(ExtraPropertyDictionary extraProperties, Type entityType) { var copyDictionary = new Dictionary(extraProperties); @@ -39,11 +40,18 @@ namespace Volo.Abp.EntityFrameworkCore.ValueConverters return JsonSerializer.Serialize(copyDictionary); } - private static Dictionary DeserializeObject(string extraPropertiesAsJson, Type entityType) + private static ExtraPropertyDictionary DeserializeObject(string extraPropertiesAsJson, Type entityType) { + if (extraPropertiesAsJson.IsNullOrEmpty() || extraPropertiesAsJson == "{}") + { + return new ExtraPropertyDictionary(); + } + var deserializeOptions = new JsonSerializerOptions(); deserializeOptions.Converters.Add(new ObjectToInferredTypesConverter()); - var dictionary = JsonSerializer.Deserialize>(extraPropertiesAsJson, deserializeOptions) ?? new Dictionary(); + var dictionary = JsonSerializer.Deserialize(extraPropertiesAsJson, deserializeOptions) ?? + new ExtraPropertyDictionary(); + if (entityType != null) { var objectExtension = ObjectExtensionManager.Instance.GetOrNull(entityType); diff --git a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/Data/ExtraPropertyDictionary.cs b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/Data/ExtraPropertyDictionary.cs new file mode 100644 index 0000000000..86a43d77a3 --- /dev/null +++ b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/Data/ExtraPropertyDictionary.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +namespace Volo.Abp.Data +{ + [Serializable] + public class ExtraPropertyDictionary : Dictionary + { + public ExtraPropertyDictionary() + { + + } + + public ExtraPropertyDictionary(IDictionary dictionary) + : base(dictionary) + { + } + } +} diff --git a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/Data/IHasExtraProperties.cs b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/Data/IHasExtraProperties.cs index a637351e66..cc236508b2 100644 --- a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/Data/IHasExtraProperties.cs +++ b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/Data/IHasExtraProperties.cs @@ -1,11 +1,9 @@ -using System.Collections.Generic; - -namespace Volo.Abp.Data +namespace Volo.Abp.Data { //TODO: Move to Volo.Abp.Data.ObjectExtending namespace at 4.0? public interface IHasExtraProperties { - Dictionary ExtraProperties { get; } + ExtraPropertyDictionary ExtraProperties { get; } } } diff --git a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ExtensibleObject.cs b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ExtensibleObject.cs index d83efac53f..d068015581 100644 --- a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ExtensibleObject.cs +++ b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ExtensibleObject.cs @@ -9,7 +9,7 @@ namespace Volo.Abp.ObjectExtending [Serializable] public class ExtensibleObject : IHasExtraProperties, IValidatableObject { - public Dictionary ExtraProperties { get; protected set; } + public ExtraPropertyDictionary ExtraProperties { get; protected set; } public ExtensibleObject() : this(true) @@ -19,7 +19,7 @@ namespace Volo.Abp.ObjectExtending public ExtensibleObject(bool setDefaultsForExtraProperties) { - ExtraProperties = new Dictionary(); + ExtraProperties = new ExtraPropertyDictionary(); if (setDefaultsForExtraProperties) { diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditLog.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditLog.cs index 63dbd4802b..25e0c9d9dc 100644 --- a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditLog.cs +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditLog.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using Volo.Abp.Auditing; +using Volo.Abp.Data; using Volo.Abp.Domain.Entities; using Volo.Abp.Guids; using Volo.Abp.MultiTenancy; @@ -55,12 +56,12 @@ namespace Volo.Abp.AuditLogging protected AuditLog() { - ExtraProperties = new Dictionary(); + } public AuditLog(IGuidGenerator guidGenerator, AuditLogInfo auditInfo) + : base(guidGenerator.Create()) { - Id = guidGenerator.Create(); ApplicationName = auditInfo.ApplicationName.Truncate(AuditLogConsts.MaxApplicationNameLength); TenantId = auditInfo.TenantId; TenantName = auditInfo.TenantName.Truncate(AuditLogConsts.MaxTenantNameLength); @@ -79,10 +80,14 @@ namespace Volo.Abp.AuditLogging ImpersonatorUserId = auditInfo.ImpersonatorUserId; ImpersonatorTenantId = auditInfo.ImpersonatorTenantId; - ExtraProperties = auditInfo - .ExtraProperties? - .ToDictionary(pair => pair.Key, pair => pair.Value) - ?? new Dictionary(); + ExtraProperties = new ExtraPropertyDictionary(); + if (auditInfo.ExtraProperties != null) + { + foreach (var pair in auditInfo.ExtraProperties) + { + ExtraProperties.Add(pair.Key, pair.Value); + } + } EntityChanges = auditInfo .EntityChanges? diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditLogAction.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditLogAction.cs index b6253e3f0e..7f6db9af5f 100644 --- a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditLogAction.cs +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditLogAction.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; using Volo.Abp.Auditing; using Volo.Abp.Data; using Volo.Abp.Domain.Entities; @@ -25,11 +23,10 @@ namespace Volo.Abp.AuditLogging public virtual int ExecutionDuration { get; protected set; } - public virtual Dictionary ExtraProperties { get; protected set; } - + public virtual ExtraPropertyDictionary ExtraProperties { get; protected set; } + protected AuditLogAction() { - ExtraProperties = new Dictionary(); } public AuditLogAction(Guid id, Guid auditLogId, AuditLogActionInfo actionInfo, Guid? tenantId = null) @@ -40,7 +37,7 @@ namespace Volo.Abp.AuditLogging AuditLogId = auditLogId; ExecutionTime = actionInfo.ExecutionTime; ExecutionDuration = actionInfo.ExecutionDuration; - ExtraProperties = actionInfo.ExtraProperties.ToDictionary(pair => pair.Key, pair => pair.Value); + ExtraProperties = new ExtraPropertyDictionary(actionInfo.ExtraProperties); ServiceName = actionInfo.ServiceName.TruncateFromBeginning(AuditLogActionConsts.MaxServiceNameLength); MethodName = actionInfo.MethodName.TruncateFromBeginning(AuditLogActionConsts.MaxMethodNameLength); Parameters = actionInfo.Parameters.Length > AuditLogActionConsts.MaxParametersLength ? "" : actionInfo.Parameters; diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/EntityChange.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/EntityChange.cs index b90843dfc0..6bb86b7980 100644 --- a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/EntityChange.cs +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/EntityChange.cs @@ -28,16 +28,16 @@ namespace Volo.Abp.AuditLogging public virtual ICollection PropertyChanges { get; protected set; } - public virtual Dictionary ExtraProperties { get; protected set; } + public virtual ExtraPropertyDictionary ExtraProperties { get; protected set; } protected EntityChange() { - ExtraProperties = new Dictionary(); + ExtraProperties = new ExtraPropertyDictionary(); } public EntityChange( - IGuidGenerator guidGenerator, - Guid auditLogId, + IGuidGenerator guidGenerator, + Guid auditLogId, EntityChangeInfo entityChangeInfo, Guid? tenantId = null) { @@ -55,10 +55,14 @@ namespace Volo.Abp.AuditLogging .ToList() ?? new List(); - ExtraProperties = entityChangeInfo - .ExtraProperties? - .ToDictionary(pair => pair.Key, pair => pair.Value) - ?? new Dictionary(); + ExtraProperties = new ExtraPropertyDictionary(); + if (entityChangeInfo.ExtraProperties != null) + { + foreach (var pair in entityChangeInfo.ExtraProperties) + { + ExtraProperties.Add(pair.Key, pair.Value); + } + } } } } diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/Document.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/Document.cs index ee8710bff3..c2ec85f33b 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/Document.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/Document.cs @@ -32,9 +32,9 @@ namespace Volo.Docs.Documents public virtual string LocalDirectory { get; set; } public virtual DateTime CreationTime { get; set; } - + public virtual DateTime LastUpdatedTime { get; set; } - + public virtual DateTime? LastSignificantUpdateTime { get; set; } public virtual DateTime LastCachedTime { get; set; } @@ -44,7 +44,6 @@ namespace Volo.Docs.Documents protected Document() { Contributors = new List(); - ExtraProperties = new Dictionary(); } public Document( @@ -65,8 +64,8 @@ namespace Volo.Docs.Documents DateTime lastCachedTime, DateTime? lastSignificantUpdateTime = null ) + : base(id) { - Id = id; ProjectId = projectId; Name = Check.NotNullOrWhiteSpace(name, nameof(name)); @@ -86,7 +85,6 @@ namespace Volo.Docs.Documents LastSignificantUpdateTime = lastSignificantUpdateTime; Contributors = new List(); - ExtraProperties = new Dictionary(); } public virtual void AddContributor(string username, string userProfileUrl, string avatarUrl) @@ -111,4 +109,4 @@ namespace Volo.Docs.Documents r.Username == username && r.UserProfileUrl == userProfileUrl && r.AvatarUrl == avatarUrl); } } -} \ No newline at end of file +} diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs index 8bc36a2106..720cf494d6 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using JetBrains.Annotations; using Volo.Abp; -using Volo.Abp.Data; using Volo.Abp.Domain.Entities; namespace Volo.Docs.Projects @@ -52,21 +51,19 @@ namespace Volo.Docs.Projects protected Project() { - ExtraProperties = new Dictionary(); } public Project( - Guid id, - [NotNull] string name, - [NotNull] string shortName, + Guid id, + [NotNull] string name, + [NotNull] string shortName, [NotNull] string documentStoreType, [NotNull] string format, - [NotNull] string defaultDocumentName = "Index", - [NotNull] string navigationDocumentName = "docs-nav.json", + [NotNull] string defaultDocumentName = "Index", + [NotNull] string navigationDocumentName = "docs-nav.json", [NotNull] string parametersDocumentName = "docs-params.json") + : base(id) { - Id = id; - Name = Check.NotNullOrWhiteSpace(name, nameof(name)); ShortName = Check.NotNullOrWhiteSpace(shortName, nameof(shortName)); DocumentStoreType = Check.NotNullOrWhiteSpace(documentStoreType, nameof(documentStoreType)); @@ -75,8 +72,6 @@ namespace Volo.Docs.Projects NavigationDocumentName = Check.NotNullOrWhiteSpace(navigationDocumentName, nameof(navigationDocumentName)); ParametersDocumentName = Check.NotNullOrWhiteSpace(parametersDocumentName, nameof(parametersDocumentName)); - ExtraProperties = new Dictionary(); - NormalizeShortName(); } @@ -110,4 +105,4 @@ namespace Volo.Docs.Projects ShortName = ShortName.ToLower(); } } -} \ No newline at end of file +} diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentitySecurityLog.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentitySecurityLog.cs index b720f667f0..b8efbc117f 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentitySecurityLog.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentitySecurityLog.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using Volo.Abp.Domain.Entities; using Volo.Abp.Guids; using Volo.Abp.MultiTenancy; @@ -35,12 +34,12 @@ namespace Volo.Abp.Identity protected IdentitySecurityLog() { - ExtraProperties = new Dictionary(); + } public IdentitySecurityLog(IGuidGenerator guidGenerator, SecurityLogInfo securityLogInfo) + : base(guidGenerator.Create()) { - Id = guidGenerator.Create(); TenantId = securityLogInfo.TenantId; TenantName = securityLogInfo.TenantName.Truncate(IdentitySecurityLogConsts.MaxTenantNameLength); @@ -57,8 +56,6 @@ namespace Volo.Abp.Identity ClientId = securityLogInfo.ClientId.Truncate(IdentitySecurityLogConsts.MaxClientIdLength); CorrelationId = securityLogInfo.CorrelationId.Truncate(IdentitySecurityLogConsts.MaxCorrelationIdLength); BrowserInfo = securityLogInfo.BrowserInfo.Truncate(IdentitySecurityLogConsts.MaxBrowserInfoLength); - - ExtraProperties = securityLogInfo.ExtraProperties; } } } diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUser.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUser.cs index 287328573d..f48553681c 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUser.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUser.cs @@ -143,11 +143,11 @@ namespace Volo.Abp.Identity [NotNull] string userName, [NotNull] string email, Guid? tenantId = null) + : base(id) { Check.NotNull(userName, nameof(userName)); Check.NotNull(email, nameof(email)); - Id = id; TenantId = tenantId; UserName = userName; NormalizedUserName = userName.ToUpperInvariant(); @@ -161,8 +161,6 @@ namespace Volo.Abp.Identity Logins = new Collection(); Tokens = new Collection(); OrganizationUnits = new Collection(); - - ExtraProperties = new Dictionary(); } public virtual void AddRole(Guid roleId) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyProjectNameGlobalFeatureConfigurator.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyProjectNameGlobalFeatureConfigurator.cs index 1b9b9731ab..f316b58687 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyProjectNameGlobalFeatureConfigurator.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyProjectNameGlobalFeatureConfigurator.cs @@ -15,7 +15,7 @@ namespace MyCompanyName.MyProjectName * YOU CAN SAFELY DELETE THIS CLASS AND REMOVE ITS USAGES IF YOU DON'T NEED TO IT! * * Please refer to the documentation to lear more about the Global Features System: - * https://docs.abp.io/en/commercial/latest/Global-Features + * https://docs.abp.io/en/abp/latest/Global-Features */ }); }