From 61b2baf67184ee3648eaf03407b9a89815dcbd5c Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Mon, 9 Jul 2018 10:01:55 +0300 Subject: [PATCH] Refactor auditing. --- .../Mvc/Auditing/AbpAuditActionFilter.cs | 1 - .../Volo/Abp/Auditing/AbpAuditingModule.cs | 1 - .../Volo/Abp/Auditing/AuditPropertySetter.cs | 4 +- .../Abp/Auditing/AuditingContractResolver.cs | 2 +- .../Volo/Abp/Auditing/AuditingHelper.cs | 39 +++++++------------ .../Volo/Abp/Auditing/AuditingInterceptor.cs | 2 - .../Auditing/AuditingInterceptorRegistrar.cs | 21 +++++++--- .../Volo/Abp/Auditing/IAudited.cs | 21 ---------- .../Volo/Abp/Auditing/IAuditedObject.cs | 19 +++++++++ .../Volo/Abp/Auditing/IAuditingEnabled.cs | 1 + .../Volo/Abp/Auditing/IAuditingStore.cs | 4 -- ...onAudited.cs => ICreationAuditedObject.cs} | 6 +-- ...onAudited.cs => IDeletionAuditedObject.cs} | 6 +-- .../Volo/Abp/Auditing/IFullAudited.cs | 19 --------- .../Volo/Abp/Auditing/IFullAuditedObject.cs | 19 +++++++++ ...dited.cs => IModificationAuditedObject.cs} | 6 +-- .../Abp/Auditing/NullClientInfoProvider.cs | 6 +-- .../Volo/Abp/{ => Data}/ISoftDelete.cs | 4 +- .../Abp/Application/Dtos/AuditedEntityDto.cs | 8 ++-- .../Dtos/AuditedEntityWithUserDto.cs | 8 ++-- .../Dtos/CreationAuditedEntityDto.cs | 8 ++-- .../Dtos/CreationAuditedEntityWithUserDto.cs | 8 ++-- .../Application/Dtos/FullAuditedEntityDto.cs | 8 ++-- .../Dtos/FullAuditedEntityWithUserDto.cs | 8 ++-- .../Entities/Auditing/AuditedAggregateRoot.cs | 8 ++-- .../Auditing/AuditedAggregateRootWithUser.cs | 8 ++-- .../Domain/Entities/Auditing/AuditedEntity.cs | 8 ++-- .../Auditing/AuditedEntityWithUser.cs | 8 ++-- .../Auditing/CreationAuditedAggregateRoot.cs | 8 ++-- .../CreationAuditedAggregateRootWithUser.cs | 8 ++-- .../Auditing/CreationAuditedEntity.cs | 8 ++-- .../Auditing/CreationAuditedEntityWithUser.cs | 8 ++-- .../Auditing/FullAuditedAggregateRoot.cs | 8 ++-- .../FullAuditedAggregateRootWithUser.cs | 8 ++-- .../Entities/Auditing/FullAuditedEntity.cs | 8 ++-- .../Auditing/FullAuditedEntityWithUser.cs | 8 ++-- .../AbpEntityTypeBuilderExtensions.cs | 18 ++++----- .../Auditing/AuditPropertySetterTestBase.cs | 2 +- 38 files changed, 169 insertions(+), 176 deletions(-) delete mode 100644 framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAudited.cs create mode 100644 framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditedObject.cs rename framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/{ICreationAudited.cs => ICreationAuditedObject.cs} (61%) rename framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/{IDeletionAudited.cs => IDeletionAuditedObject.cs} (71%) delete mode 100644 framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IFullAudited.cs create mode 100644 framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IFullAuditedObject.cs rename framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/{IModificationAudited.cs => IModificationAuditedObject.cs} (77%) rename framework/src/Volo.Abp.Data/Volo/Abp/{ => Data}/ISoftDelete.cs (80%) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditActionFilter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditActionFilter.cs index 4f2abc198c..76907c4e65 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditActionFilter.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditActionFilter.cs @@ -56,7 +56,6 @@ namespace Volo.Abp.AspNetCore.Mvc.Auditing { stopwatch.Stop(); auditInfo.ExecutionDuration = Convert.ToInt32(stopwatch.Elapsed.TotalMilliseconds); - auditInfo.ServiceName = "AbpAuditActionFilter->" + auditInfo.ServiceName; await _auditingHelper.SaveAsync(auditInfo); } } diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingModule.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingModule.cs index c475245ac3..482fc9fa02 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingModule.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingModule.cs @@ -7,7 +7,6 @@ using Volo.Abp.Timing; namespace Volo.Abp.Auditing { - //TODO: Can we remove AbpDataModule dependency since it only contains ISoftDelete related to auditing module! [DependsOn( typeof(AbpDataModule), typeof(AbpTimingModule), diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditPropertySetter.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditPropertySetter.cs index c273799c6b..1863c8f938 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditPropertySetter.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditPropertySetter.cs @@ -105,7 +105,7 @@ namespace Volo.Abp.Auditing private void SetLastModifierId(object targetObject) { - if (!(targetObject is IModificationAudited modificationAuditedObject)) + if (!(targetObject is IModificationAuditedObject modificationAuditedObject)) { return; } @@ -150,7 +150,7 @@ namespace Volo.Abp.Auditing private void SetDeleterId(object targetObject) { - if (!(targetObject is IDeletionAudited deletionAuditedObject)) + if (!(targetObject is IDeletionAuditedObject deletionAuditedObject)) { return; } diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingContractResolver.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingContractResolver.cs index 4607355a37..24f86ce0b4 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingContractResolver.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingContractResolver.cs @@ -17,7 +17,7 @@ namespace Volo.Abp.Auditing protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) { - JsonProperty property = base.CreateProperty(member, memberSerialization); + var property = base.CreateProperty(member, memberSerialization); if (member.IsDefined(typeof(DisableAuditingAttribute)) || member.IsDefined(typeof(JsonIgnoreAttribute))) { diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingHelper.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingHelper.cs index 089ec87d4c..3f20cc5e7d 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingHelper.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingHelper.cs @@ -4,7 +4,6 @@ using System.Linq; using System.Reflection; using System.Threading.Tasks; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using Volo.Abp.DependencyInjection; using Volo.Abp.MultiTenancy; @@ -15,9 +14,8 @@ namespace Volo.Abp.Auditing { public class AuditingHelper : IAuditingHelper, ITransientDependency { - public ILogger Logger { get; set; } - - public IAuditingStore AuditingStore { get; set; } + protected ILogger Logger { get; } + protected IAuditingStore AuditingStore { get; } protected ICurrentUser CurrentUser { get; } protected ICurrentTenant CurrentTenant { get; } protected IClock Clock { get; } @@ -31,7 +29,9 @@ namespace Volo.Abp.Auditing IOptions options, ICurrentUser currentUser, ICurrentTenant currentTenant, - IClock clock) + IClock clock, + IAuditingStore auditingStore, + ILogger logger) { AuditInfoProvider = auditInfoProvider; Options = options.Value; @@ -39,11 +39,12 @@ namespace Volo.Abp.Auditing CurrentUser = currentUser; CurrentTenant = currentTenant; Clock = clock; + AuditingStore = auditingStore; - Logger = NullLogger.Instance; + Logger = logger; } - public bool ShouldSaveAudit(MethodInfo methodInfo, bool defaultValue = false) + public virtual bool ShouldSaveAudit(MethodInfo methodInfo, bool defaultValue = false) { if (!Options.IsEnabled) { @@ -78,17 +79,7 @@ namespace Volo.Abp.Auditing var classType = methodInfo.DeclaringType; if (classType != null) { - if (classType.IsDefined(typeof(AuditedAttribute), true)) - { - return true; - } - - if (classType.IsDefined(typeof(DisableAuditingAttribute), true)) - { - return false; - } - - if (typeof(IAuditingEnabled).IsAssignableFrom(classType)) + if (AuditingInterceptorRegistrar.ShouldAuditTypeByDefault(classType)) { return true; } @@ -97,12 +88,12 @@ namespace Volo.Abp.Auditing return defaultValue; } - public AuditInfo CreateAuditInfo(Type type, MethodInfo method, object[] arguments) + public virtual AuditInfo CreateAuditInfo(Type type, MethodInfo method, object[] arguments) { return CreateAuditInfo(type, method, CreateArgumentsDictionary(method, arguments)); } - public AuditInfo CreateAuditInfo(Type type, MethodInfo method, IDictionary arguments) + public virtual AuditInfo CreateAuditInfo(Type type, MethodInfo method, IDictionary arguments) { var auditInfo = new AuditInfo { @@ -130,17 +121,17 @@ namespace Volo.Abp.Auditing return auditInfo; } - public void Save(AuditInfo auditInfo) + public virtual void Save(AuditInfo auditInfo) { AuditingStore.Save(auditInfo); } - public async Task SaveAsync(AuditInfo auditInfo) + public virtual async Task SaveAsync(AuditInfo auditInfo) { await AuditingStore.SaveAsync(auditInfo); } - private string SerializeConvertArguments(IDictionary arguments) + protected virtual string SerializeConvertArguments(IDictionary arguments) { try { @@ -172,7 +163,7 @@ namespace Volo.Abp.Auditing } } - private static Dictionary CreateArgumentsDictionary(MethodInfo method, object[] arguments) + protected virtual Dictionary CreateArgumentsDictionary(MethodInfo method, object[] arguments) { var parameters = method.GetParameters(); var dictionary = new Dictionary(); diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs index c3ed008dd2..94df027751 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs @@ -47,7 +47,6 @@ namespace Volo.Abp.Auditing { stopwatch.Stop(); auditInfo.ExecutionDuration = Convert.ToInt32(stopwatch.Elapsed.TotalMilliseconds); - auditInfo.ServiceName = "AuditingInterceptor->" + auditInfo.ServiceName; _auditingHelper.Save(auditInfo); } } @@ -84,7 +83,6 @@ namespace Volo.Abp.Auditing { stopwatch.Stop(); auditInfo.ExecutionDuration = Convert.ToInt32(stopwatch.Elapsed.TotalMilliseconds); - auditInfo.ServiceName = "AuditingInterceptor->" + auditInfo.ServiceName; await _auditingHelper.SaveAsync(auditInfo); } } diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptorRegistrar.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptorRegistrar.cs index 57a7f4b94e..e901dbc037 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptorRegistrar.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptorRegistrar.cs @@ -16,22 +16,33 @@ namespace Volo.Abp.Auditing private static bool ShouldIntercept(Type type) { - if (type.IsDefined(typeof(AuditedAttribute), true)) + if (ShouldAuditTypeByDefault(type)) { return true; } - if (type.IsDefined(typeof(DisableAuditingAttribute), true)) + if (type.GetMethods().Any(m => m.IsDefined(typeof(AuditedAttribute), true))) { - return false; + return true; } - if (typeof(IAuditingEnabled).IsAssignableFrom(type)) + return false; + } + + //TODO: Move to a better place + internal static bool ShouldAuditTypeByDefault(Type type) + { + if (type.IsDefined(typeof(AuditedAttribute), true)) { return true; } - if (type.GetMethods().Any(m => m.IsDefined(typeof(AuditedAttribute), true))) + if (type.IsDefined(typeof(DisableAuditingAttribute), true)) + { + return false; + } + + if (typeof(IAuditingEnabled).IsAssignableFrom(type)) { return true; } diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAudited.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAudited.cs deleted file mode 100644 index 7936ba5b0a..0000000000 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAudited.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Volo.Abp.Auditing -{ - //TODO: Rename IAudited to IAuditedObject (also for ICreationAudited, IDeletionAudited... and so on) - - /// - /// This interface can be implemented to add standard auditing properties to a class. - /// - public interface IAudited : ICreationAudited, IModificationAudited - { - - } - - /// - /// Extends to add user navigation properties. - /// - /// Type of the user - public interface IAudited : IAudited, ICreationAudited, IModificationAudited - { - - } -} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditedObject.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditedObject.cs new file mode 100644 index 0000000000..694062f927 --- /dev/null +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditedObject.cs @@ -0,0 +1,19 @@ +namespace Volo.Abp.Auditing +{ + /// + /// This interface can be implemented to add standard auditing properties to a class. + /// + public interface IAuditedObject : ICreationAuditedObject, IModificationAuditedObject + { + + } + + /// + /// Extends to add user navigation properties. + /// + /// Type of the user + public interface IAuditedObject : IAuditedObject, ICreationAuditedObject, IModificationAuditedObject + { + + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingEnabled.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingEnabled.cs index d4de868817..22ae318d93 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingEnabled.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingEnabled.cs @@ -2,5 +2,6 @@ { public interface IAuditingEnabled { + } } diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingStore.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingStore.cs index 92a456c197..561878136d 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingStore.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingStore.cs @@ -4,10 +4,6 @@ namespace Volo.Abp.Auditing { public interface IAuditingStore { - /// - /// Should save audits to a persistent store. - /// - /// Audit informations Task SaveAsync(AuditInfo auditInfo); } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/ICreationAudited.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/ICreationAuditedObject.cs similarity index 61% rename from framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/ICreationAudited.cs rename to framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/ICreationAuditedObject.cs index 14d53e4fd9..ee381685c6 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/ICreationAudited.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/ICreationAuditedObject.cs @@ -3,16 +3,16 @@ namespace Volo.Abp.Auditing /// /// This interface can be implemented to store creation information (who and when created). /// - public interface ICreationAudited : IHasCreationTime, IMayHaveCreator + public interface ICreationAuditedObject : IHasCreationTime, IMayHaveCreator { } /// - /// Adds navigation property (object reference) to interface. + /// Adds navigation property (object reference) to interface. /// /// Type of the user - public interface ICreationAudited : ICreationAudited, IMayHaveCreator + public interface ICreationAuditedObject : ICreationAuditedObject, IMayHaveCreator { } diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IDeletionAudited.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IDeletionAuditedObject.cs similarity index 71% rename from framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IDeletionAudited.cs rename to framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IDeletionAuditedObject.cs index 8b1d313ad0..75df523ea4 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IDeletionAudited.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IDeletionAuditedObject.cs @@ -5,7 +5,7 @@ namespace Volo.Abp.Auditing /// /// This interface can be implemented to store deletion information (who delete and when deleted). /// - public interface IDeletionAudited : IHasDeletionTime + public interface IDeletionAuditedObject : IHasDeletionTime { /// /// Id of the deleter user. @@ -14,10 +14,10 @@ namespace Volo.Abp.Auditing } /// - /// Extends to add user navigation propery. + /// Extends to add user navigation propery. /// /// Type of the user - public interface IDeletionAudited : IDeletionAudited + public interface IDeletionAuditedObject : IDeletionAuditedObject { /// /// Reference to the deleter user. diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IFullAudited.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IFullAudited.cs deleted file mode 100644 index 7a934f94d4..0000000000 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IFullAudited.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Volo.Abp.Auditing -{ - /// - /// This interface adds to . - /// - public interface IFullAudited : IAudited, IDeletionAudited - { - - } - - /// - /// Adds user navigation properties to interface for user. - /// - /// Type of the user - public interface IFullAudited : IAudited, IFullAudited, IDeletionAudited - { - - } -} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IFullAuditedObject.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IFullAuditedObject.cs new file mode 100644 index 0000000000..2d58166981 --- /dev/null +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IFullAuditedObject.cs @@ -0,0 +1,19 @@ +namespace Volo.Abp.Auditing +{ + /// + /// This interface adds to . + /// + public interface IFullAuditedObject : IAuditedObject, IDeletionAuditedObject + { + + } + + /// + /// Adds user navigation properties to interface for user. + /// + /// Type of the user + public interface IFullAuditedObject : IAuditedObject, IFullAuditedObject, IDeletionAuditedObject + { + + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IModificationAudited.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IModificationAuditedObject.cs similarity index 77% rename from framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IModificationAudited.cs rename to framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IModificationAuditedObject.cs index 56a81a3d79..492b6ef13c 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IModificationAudited.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IModificationAuditedObject.cs @@ -5,7 +5,7 @@ namespace Volo.Abp.Auditing /// /// This interface can be implemented to store modification information (who and when modified lastly). /// - public interface IModificationAudited : IHasModificationTime + public interface IModificationAuditedObject : IHasModificationTime { /// /// Last modifier user for this entity. @@ -14,10 +14,10 @@ namespace Volo.Abp.Auditing } /// - /// Adds navigation properties to interface for a user. + /// Adds navigation properties to interface for a user. /// /// Type of the user - public interface IModificationAudited : IModificationAudited + public interface IModificationAuditedObject : IModificationAuditedObject { /// /// Reference to the last modifier user of this entity. diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/NullClientInfoProvider.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/NullClientInfoProvider.cs index caadb3bf1a..3a3c997d1e 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/NullClientInfoProvider.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/NullClientInfoProvider.cs @@ -2,13 +2,13 @@ namespace Volo.Abp.Auditing { - //TODO: Implement on aspnet core layer + [Dependency(TryRegister = true)] public class NullClientInfoProvider : IClientInfoProvider, ISingletonDependency { - public static NullClientInfoProvider Instance { get; } = new NullClientInfoProvider(); - public string BrowserInfo => null; + public string ClientIpAddress => null; + public string ComputerName => null; } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Data/Volo/Abp/ISoftDelete.cs b/framework/src/Volo.Abp.Data/Volo/Abp/Data/ISoftDelete.cs similarity index 80% rename from framework/src/Volo.Abp.Data/Volo/Abp/ISoftDelete.cs rename to framework/src/Volo.Abp.Data/Volo/Abp/Data/ISoftDelete.cs index cfdd8d2419..29a1610051 100644 --- a/framework/src/Volo.Abp.Data/Volo/Abp/ISoftDelete.cs +++ b/framework/src/Volo.Abp.Data/Volo/Abp/Data/ISoftDelete.cs @@ -1,4 +1,4 @@ -namespace Volo.Abp +namespace Volo.Abp //TODO: Change namespace to Volo.Abp.Data { /// /// Used to standardize soft deleting entities. @@ -6,7 +6,7 @@ /// marked as IsDeleted = true in the database, /// but can not be retrieved to the application normally. /// - public interface ISoftDelete //TODO: Move to another assembly? + public interface ISoftDelete { /// /// Used to mark an Entity as 'Deleted'. diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/AuditedEntityDto.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/AuditedEntityDto.cs index 12a0bd356b..c82ab1b2c7 100644 --- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/AuditedEntityDto.cs +++ b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/AuditedEntityDto.cs @@ -4,10 +4,10 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Application.Dtos { /// - /// This class can be inherited by DTO classes to implement interface. + /// This class can be inherited by DTO classes to implement interface. /// [Serializable] - public abstract class AuditedEntityDto : CreationAuditedEntityDto, IAudited + public abstract class AuditedEntityDto : CreationAuditedEntityDto, IAuditedObject { /// public DateTime? LastModificationTime { get; set; } @@ -17,11 +17,11 @@ namespace Volo.Abp.Application.Dtos } /// - /// This class can be inherited by DTO classes to implement interface. + /// This class can be inherited by DTO classes to implement interface. /// /// Type of primary key [Serializable] - public abstract class AuditedEntityDto : CreationAuditedEntityDto, IAudited + public abstract class AuditedEntityDto : CreationAuditedEntityDto, IAuditedObject { /// public DateTime? LastModificationTime { get; set; } diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/AuditedEntityWithUserDto.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/AuditedEntityWithUserDto.cs index fad4c11389..c5dd43de14 100644 --- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/AuditedEntityWithUserDto.cs +++ b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/AuditedEntityWithUserDto.cs @@ -4,11 +4,11 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Application.Dtos { /// - /// This class can be inherited by DTO classes to implement interface. + /// This class can be inherited by DTO classes to implement interface. /// /// Type of the User DTO [Serializable] - public abstract class AuditedEntityWithUserDto : AuditedEntityDto, IAudited + public abstract class AuditedEntityWithUserDto : AuditedEntityDto, IAuditedObject { /// public TUserDto Creator { get; set; } @@ -18,12 +18,12 @@ namespace Volo.Abp.Application.Dtos } /// - /// This class can be inherited by DTO classes to implement interface. + /// This class can be inherited by DTO classes to implement interface. /// /// Type of primary key /// Type of the User DTO [Serializable] - public abstract class AuditedEntityWithUserDto : AuditedEntityDto, IAudited + public abstract class AuditedEntityWithUserDto : AuditedEntityDto, IAuditedObject { /// public TUserDto Creator { get; set; } diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/CreationAuditedEntityDto.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/CreationAuditedEntityDto.cs index a92293b624..41328d0d30 100644 --- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/CreationAuditedEntityDto.cs +++ b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/CreationAuditedEntityDto.cs @@ -4,10 +4,10 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Application.Dtos { /// - /// This class can be inherited by DTO classes to implement interface. + /// This class can be inherited by DTO classes to implement interface. /// [Serializable] - public abstract class CreationAuditedEntityDto : EntityDto, ICreationAudited + public abstract class CreationAuditedEntityDto : EntityDto, ICreationAuditedObject { /// public DateTime CreationTime { get; set; } @@ -17,11 +17,11 @@ namespace Volo.Abp.Application.Dtos } /// - /// This class can be inherited by DTO classes to implement interface. + /// This class can be inherited by DTO classes to implement interface. /// /// Type of primary key [Serializable] - public abstract class CreationAuditedEntityDto : EntityDto, ICreationAudited + public abstract class CreationAuditedEntityDto : EntityDto, ICreationAuditedObject { /// public DateTime CreationTime { get; set; } diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/CreationAuditedEntityWithUserDto.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/CreationAuditedEntityWithUserDto.cs index a8cfbf851f..51e3c9018a 100644 --- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/CreationAuditedEntityWithUserDto.cs +++ b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/CreationAuditedEntityWithUserDto.cs @@ -4,22 +4,22 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Application.Dtos { /// - /// This class can be inherited by DTO classes to implement interface. + /// This class can be inherited by DTO classes to implement interface. /// /// Type of the User DTO [Serializable] - public abstract class CreationAuditedEntityWithUserDto : CreationAuditedEntityDto, ICreationAudited + public abstract class CreationAuditedEntityWithUserDto : CreationAuditedEntityDto, ICreationAuditedObject { public TUserDto Creator { get; set; } } /// - /// This class can be inherited by DTO classes to implement interface. + /// This class can be inherited by DTO classes to implement interface. /// /// Type of primary key /// Type of the User DTO [Serializable] - public abstract class CreationAuditedEntityWithUserDto : CreationAuditedEntityDto, ICreationAudited + public abstract class CreationAuditedEntityWithUserDto : CreationAuditedEntityDto, ICreationAuditedObject { public TUserDto Creator { get; set; } } diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/FullAuditedEntityDto.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/FullAuditedEntityDto.cs index 0b59201da0..cef3dcdfa3 100644 --- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/FullAuditedEntityDto.cs +++ b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/FullAuditedEntityDto.cs @@ -4,10 +4,10 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Application.Dtos { /// - /// This class can be inherited by DTO classes to implement interface. + /// This class can be inherited by DTO classes to implement interface. /// [Serializable] - public abstract class FullAuditedEntityDto : AuditedEntityDto, IFullAudited + public abstract class FullAuditedEntityDto : AuditedEntityDto, IFullAuditedObject { /// public bool IsDeleted { get; set; } @@ -20,11 +20,11 @@ namespace Volo.Abp.Application.Dtos } /// - /// This class can be inherited by DTO classes to implement interface. + /// This class can be inherited by DTO classes to implement interface. /// /// Type of primary key [Serializable] - public abstract class FullAuditedEntityDto : AuditedEntityDto, IFullAudited + public abstract class FullAuditedEntityDto : AuditedEntityDto, IFullAuditedObject { /// public bool IsDeleted { get; set; } diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/FullAuditedEntityWithUserDto.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/FullAuditedEntityWithUserDto.cs index f7870d0771..91e31250fb 100644 --- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/FullAuditedEntityWithUserDto.cs +++ b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Dtos/FullAuditedEntityWithUserDto.cs @@ -4,11 +4,11 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Application.Dtos { /// - /// This class can be inherited by DTO classes to implement interface. + /// This class can be inherited by DTO classes to implement interface. /// /// Type of the User [Serializable] - public abstract class FullAuditedEntityWithUserDto : FullAuditedEntityDto, IFullAudited + public abstract class FullAuditedEntityWithUserDto : FullAuditedEntityDto, IFullAuditedObject { /// public TUserDto Creator { get; set; } @@ -21,12 +21,12 @@ namespace Volo.Abp.Application.Dtos } /// - /// This class can be inherited by DTO classes to implement interface. + /// This class can be inherited by DTO classes to implement interface. /// /// Type of primary key /// Type of the User [Serializable] - public abstract class FullAuditedEntityWithUserDto : FullAuditedEntityDto, IFullAudited + public abstract class FullAuditedEntityWithUserDto : FullAuditedEntityDto, IFullAuditedObject { /// public TUserDto Creator { get; set; } diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedAggregateRoot.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedAggregateRoot.cs index 69965f5a14..8f566f1b6b 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedAggregateRoot.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedAggregateRoot.cs @@ -4,10 +4,10 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Domain.Entities.Auditing { /// - /// This class can be used to simplify implementing for aggregate roots. + /// This class can be used to simplify implementing for aggregate roots. /// [Serializable] - public abstract class AuditedAggregateRoot : CreationAuditedAggregateRoot, IAudited + public abstract class AuditedAggregateRoot : CreationAuditedAggregateRoot, IAuditedObject { /// public virtual DateTime? LastModificationTime { get; set; } @@ -17,11 +17,11 @@ namespace Volo.Abp.Domain.Entities.Auditing } /// - /// This class can be used to simplify implementing for aggregate roots. + /// This class can be used to simplify implementing for aggregate roots. /// /// Type of the primary key of the entity [Serializable] - public abstract class AuditedAggregateRoot : CreationAuditedAggregateRoot, IAudited + public abstract class AuditedAggregateRoot : CreationAuditedAggregateRoot, IAuditedObject { /// public virtual DateTime? LastModificationTime { get; set; } diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedAggregateRootWithUser.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedAggregateRootWithUser.cs index 2378e49e4d..107fb35b68 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedAggregateRootWithUser.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedAggregateRootWithUser.cs @@ -4,11 +4,11 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Domain.Entities.Auditing { /// - /// This class can be used to simplify implementing for aggregate roots. + /// This class can be used to simplify implementing for aggregate roots. /// /// Type of the user [Serializable] - public abstract class AuditedAggregateRootWithUser : AuditedAggregateRoot, IAudited + public abstract class AuditedAggregateRootWithUser : AuditedAggregateRoot, IAuditedObject where TUser : IEntity { /// @@ -19,12 +19,12 @@ namespace Volo.Abp.Domain.Entities.Auditing } /// - /// This class can be used to simplify implementing for aggregate roots. + /// This class can be used to simplify implementing for aggregate roots. /// /// Type of the primary key of the entity /// Type of the user [Serializable] - public abstract class AuditedAggregateRootWithUser : AuditedAggregateRoot, IAudited + public abstract class AuditedAggregateRootWithUser : AuditedAggregateRoot, IAuditedObject where TUser : IEntity { /// diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedEntity.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedEntity.cs index 62fdd93dcd..2ccc1aa1e2 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedEntity.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedEntity.cs @@ -4,10 +4,10 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Domain.Entities.Auditing { /// - /// This class can be used to simplify implementing . + /// This class can be used to simplify implementing . /// [Serializable] - public abstract class AuditedEntity : CreationAuditedEntity, IAudited + public abstract class AuditedEntity : CreationAuditedEntity, IAuditedObject { /// public virtual DateTime? LastModificationTime { get; set; } @@ -17,11 +17,11 @@ namespace Volo.Abp.Domain.Entities.Auditing } /// - /// This class can be used to simplify implementing . + /// This class can be used to simplify implementing . /// /// Type of the primary key of the entity [Serializable] - public abstract class AuditedEntity : CreationAuditedEntity, IAudited + public abstract class AuditedEntity : CreationAuditedEntity, IAuditedObject { /// public virtual DateTime? LastModificationTime { get; set; } diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedEntityWithUser.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedEntityWithUser.cs index b45fd8916e..76002b2114 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedEntityWithUser.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedEntityWithUser.cs @@ -4,11 +4,11 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Domain.Entities.Auditing { /// - /// This class can be used to simplify implementing . + /// This class can be used to simplify implementing . /// /// Type of the user [Serializable] - public abstract class AuditedEntityWithUser : AuditedEntity, IAudited + public abstract class AuditedEntityWithUser : AuditedEntity, IAuditedObject where TUser : IEntity { /// @@ -19,12 +19,12 @@ namespace Volo.Abp.Domain.Entities.Auditing } /// - /// This class can be used to simplify implementing . + /// This class can be used to simplify implementing . /// /// Type of the primary key of the entity /// Type of the user [Serializable] - public abstract class AuditedEntityWithUser : AuditedEntity, IAudited + public abstract class AuditedEntityWithUser : AuditedEntity, IAuditedObject where TUser : IEntity { /// diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedAggregateRoot.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedAggregateRoot.cs index f233bbadb5..29c01bd466 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedAggregateRoot.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedAggregateRoot.cs @@ -4,10 +4,10 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Domain.Entities.Auditing { /// - /// This class can be used to simplify implementing for aggregate roots. + /// This class can be used to simplify implementing for aggregate roots. /// [Serializable] - public abstract class CreationAuditedAggregateRoot : AggregateRoot, ICreationAudited + public abstract class CreationAuditedAggregateRoot : AggregateRoot, ICreationAuditedObject { /// public virtual DateTime CreationTime { get; set; } @@ -17,11 +17,11 @@ namespace Volo.Abp.Domain.Entities.Auditing } /// - /// This class can be used to simplify implementing for aggregate roots. + /// This class can be used to simplify implementing for aggregate roots. /// /// Type of the primary key of the entity [Serializable] - public abstract class CreationAuditedAggregateRoot : AggregateRoot, ICreationAudited + public abstract class CreationAuditedAggregateRoot : AggregateRoot, ICreationAuditedObject { /// public virtual DateTime CreationTime { get; set; } diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedAggregateRootWithUser.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedAggregateRootWithUser.cs index e10bc58b34..1084360749 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedAggregateRootWithUser.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedAggregateRootWithUser.cs @@ -4,23 +4,23 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Domain.Entities.Auditing { /// - /// This class can be used to simplify implementing for aggregate roots. + /// This class can be used to simplify implementing for aggregate roots. /// /// Type of the user [Serializable] - public abstract class CreationAuditedAggregateRootWithUser : CreationAuditedAggregateRoot, ICreationAudited + public abstract class CreationAuditedAggregateRootWithUser : CreationAuditedAggregateRoot, ICreationAuditedObject { /// public virtual TUser Creator { get; set; } } /// - /// This class can be used to simplify implementing for aggregate roots. + /// This class can be used to simplify implementing for aggregate roots. /// /// Type of the primary key of the entity /// Type of the user [Serializable] - public abstract class CreationAuditedAggregateRootWithUser : CreationAuditedAggregateRoot, ICreationAudited + public abstract class CreationAuditedAggregateRootWithUser : CreationAuditedAggregateRoot, ICreationAuditedObject { /// public virtual TUser Creator { get; set; } diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedEntity.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedEntity.cs index 8a0781a5df..1ab527dc2a 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedEntity.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedEntity.cs @@ -4,10 +4,10 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Domain.Entities.Auditing { /// - /// This class can be used to simplify implementing for an entity. + /// This class can be used to simplify implementing for an entity. /// [Serializable] - public abstract class CreationAuditedEntity : Entity, ICreationAudited + public abstract class CreationAuditedEntity : Entity, ICreationAuditedObject { /// public virtual DateTime CreationTime { get; set; } @@ -17,11 +17,11 @@ namespace Volo.Abp.Domain.Entities.Auditing } /// - /// This class can be used to simplify implementing for an entity. + /// This class can be used to simplify implementing for an entity. /// /// Type of the primary key of the entity [Serializable] - public abstract class CreationAuditedEntity : Entity, ICreationAudited + public abstract class CreationAuditedEntity : Entity, ICreationAuditedObject { /// public virtual DateTime CreationTime { get; set; } diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedEntityWithUser.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedEntityWithUser.cs index 86b4696c05..0989dfeac4 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedEntityWithUser.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedEntityWithUser.cs @@ -4,23 +4,23 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Domain.Entities.Auditing { /// - /// This class can be used to simplify implementing . + /// This class can be used to simplify implementing . /// /// Type of the user [Serializable] - public abstract class CreationAuditedEntityWithUser : CreationAuditedEntity, ICreationAudited + public abstract class CreationAuditedEntityWithUser : CreationAuditedEntity, ICreationAuditedObject { /// public virtual TUser Creator { get; set; } } /// - /// This class can be used to simplify implementing . + /// This class can be used to simplify implementing . /// /// Type of the primary key of the entity /// Type of the user [Serializable] - public abstract class CreationAuditedEntityWithUser : CreationAuditedEntity, ICreationAudited + public abstract class CreationAuditedEntityWithUser : CreationAuditedEntity, ICreationAuditedObject { /// public virtual TUser Creator { get; set; } diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedAggregateRoot.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedAggregateRoot.cs index 1dd0c2d8cb..397a425629 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedAggregateRoot.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedAggregateRoot.cs @@ -4,10 +4,10 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Domain.Entities.Auditing { /// - /// Implements to be a base class for full-audited aggregate roots. + /// Implements to be a base class for full-audited aggregate roots. /// [Serializable] - public abstract class FullAuditedAggregateRoot : AuditedAggregateRoot, IFullAudited + public abstract class FullAuditedAggregateRoot : AuditedAggregateRoot, IFullAuditedObject { /// public virtual bool IsDeleted { get; set; } @@ -20,11 +20,11 @@ namespace Volo.Abp.Domain.Entities.Auditing } /// - /// Implements to be a base class for full-audited aggregate roots. + /// Implements to be a base class for full-audited aggregate roots. /// /// Type of the primary key of the entity [Serializable] - public abstract class FullAuditedAggregateRoot : AuditedAggregateRoot, IFullAudited + public abstract class FullAuditedAggregateRoot : AuditedAggregateRoot, IFullAuditedObject { /// public virtual bool IsDeleted { get; set; } diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedAggregateRootWithUser.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedAggregateRootWithUser.cs index ce93fa6b8d..d379a78240 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedAggregateRootWithUser.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedAggregateRootWithUser.cs @@ -4,11 +4,11 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Domain.Entities.Auditing { /// - /// Implements to be a base class for full-audited aggregate roots. + /// Implements to be a base class for full-audited aggregate roots. /// /// Type of the user [Serializable] - public abstract class FullAuditedAggregateRootWithUser : FullAuditedAggregateRoot, IFullAudited + public abstract class FullAuditedAggregateRootWithUser : FullAuditedAggregateRoot, IFullAuditedObject where TUser : IEntity { /// @@ -22,12 +22,12 @@ namespace Volo.Abp.Domain.Entities.Auditing } /// - /// Implements to be a base class for full-audited aggregate roots. + /// Implements to be a base class for full-audited aggregate roots. /// /// Type of the primary key of the entity /// Type of the user [Serializable] - public abstract class FullAuditedAggregateRootWithUser : FullAuditedAggregateRoot, IFullAudited + public abstract class FullAuditedAggregateRootWithUser : FullAuditedAggregateRoot, IFullAuditedObject where TUser : IEntity { /// diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedEntity.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedEntity.cs index b9f6f289cc..20b07b85b5 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedEntity.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedEntity.cs @@ -4,10 +4,10 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Domain.Entities.Auditing { /// - /// Implements to be a base class for full-audited entities. + /// Implements to be a base class for full-audited entities. /// [Serializable] - public abstract class FullAuditedEntity : AuditedEntity, IFullAudited + public abstract class FullAuditedEntity : AuditedEntity, IFullAuditedObject { /// public virtual bool IsDeleted { get; set; } @@ -20,11 +20,11 @@ namespace Volo.Abp.Domain.Entities.Auditing } /// - /// Implements to be a base class for full-audited entities. + /// Implements to be a base class for full-audited entities. /// /// Type of the primary key of the entity [Serializable] - public abstract class FullAuditedEntity : AuditedEntity, IFullAudited + public abstract class FullAuditedEntity : AuditedEntity, IFullAuditedObject { /// public virtual bool IsDeleted { get; set; } diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedEntityWithUser.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedEntityWithUser.cs index 12311820d2..9aba520480 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedEntityWithUser.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedEntityWithUser.cs @@ -4,11 +4,11 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Domain.Entities.Auditing { /// - /// Implements to be a base class for full-audited entities. + /// Implements to be a base class for full-audited entities. /// /// Type of the user [Serializable] - public abstract class FullAuditedEntityWithUser : FullAuditedEntity, IFullAudited + public abstract class FullAuditedEntityWithUser : FullAuditedEntity, IFullAuditedObject where TUser : IEntity { /// @@ -22,12 +22,12 @@ namespace Volo.Abp.Domain.Entities.Auditing } /// - /// Implements to be a base class for full-audited entities. + /// Implements to be a base class for full-audited entities. /// /// Type of the primary key of the entity /// Type of the user [Serializable] - public abstract class FullAuditedEntityWithUser : FullAuditedEntity, IFullAudited + public abstract class FullAuditedEntityWithUser : FullAuditedEntity, IFullAuditedObject where TUser : IEntity { /// 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 1d11b04cc9..b386c8e803 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 @@ -46,10 +46,10 @@ namespace Volo.Abp.EntityFrameworkCore.Modeling } public static void ConfigureDeletionAudited(this EntityTypeBuilder b) - where T : class, IDeletionAudited + where T : class, IDeletionAuditedObject { b.ConfigureDeletionTime(); - b.Property(x => x.DeleterId).IsRequired(false).HasColumnName(nameof(IDeletionAudited.DeleterId)); + b.Property(x => x.DeleterId).IsRequired(false).HasColumnName(nameof(IDeletionAuditedObject.DeleterId)); } public static void ConfigureCreationTime(this EntityTypeBuilder b) @@ -59,10 +59,10 @@ namespace Volo.Abp.EntityFrameworkCore.Modeling } public static void ConfigureCreationAudited(this EntityTypeBuilder b) - where T : class, ICreationAudited + where T : class, ICreationAuditedObject { b.ConfigureCreationTime(); - b.Property(x => x.CreatorId).IsRequired(false).HasColumnName(nameof(ICreationAudited.CreatorId)); + b.Property(x => x.CreatorId).IsRequired(false).HasColumnName(nameof(ICreationAuditedObject.CreatorId)); } public static void ConfigureLastModificationTime(this EntityTypeBuilder b) @@ -72,26 +72,26 @@ namespace Volo.Abp.EntityFrameworkCore.Modeling } public static void ConfigureModificationAudited(this EntityTypeBuilder b) - where T : class, IModificationAudited + where T : class, IModificationAuditedObject { b.ConfigureLastModificationTime(); - b.Property(x => x.LastModifierId).IsRequired(false).HasColumnName(nameof(IModificationAudited.LastModifierId)); + b.Property(x => x.LastModifierId).IsRequired(false).HasColumnName(nameof(IModificationAuditedObject.LastModifierId)); } public static void ConfigureAudited(this EntityTypeBuilder b) - where T : class, IAudited + where T : class, IAuditedObject { b.ConfigureCreationAudited(); b.ConfigureModificationAudited(); } public static void ConfigureFullAudited(this EntityTypeBuilder b) - where T : class, IFullAudited + where T : class, IFullAuditedObject { b.ConfigureAudited(); b.ConfigureDeletionAudited(); } - //TODO: Add other interfaces (IMultiTenant, IAudited...) + //TODO: Add other interfaces (IMultiTenant, IAuditedObject...) } } diff --git a/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/AuditPropertySetterTestBase.cs b/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/AuditPropertySetterTestBase.cs index dd1ba7a235..9ecadd9a2c 100644 --- a/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/AuditPropertySetterTestBase.cs +++ b/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/AuditPropertySetterTestBase.cs @@ -48,7 +48,7 @@ namespace Volo.Abp.Auditing } - public class MyAuditedObject : IMultiTenant, IFullAudited + public class MyAuditedObject : IMultiTenant, IFullAuditedObject { public Guid? TenantId { get; set; } public DateTime CreationTime { get; set; }