mirror of https://github.com/abpframework/abp.git
5 changed files with 96 additions and 32 deletions
@ -1,27 +1,19 @@ |
|||
using System; |
|||
|
|||
namespace Volo.Abp.Auditing |
|||
{ |
|||
/// <summary>
|
|||
/// This interface can be implemented to store creation information (who and when created).
|
|||
/// </summary>
|
|||
public interface ICreationAudited : IHasCreationTime |
|||
public interface ICreationAudited : IHasCreationTime, IMayHaveCreator |
|||
{ |
|||
/// <summary>
|
|||
/// Id of the creator user.
|
|||
/// </summary>
|
|||
Guid? CreatorId { get; set; } |
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Adds navigation properties to <see cref="ICreationAudited"/> interface for user.
|
|||
/// Adds navigation property (object reference) to <see cref="ICreationAudited"/> interface.
|
|||
/// </summary>
|
|||
/// <typeparam name="TUser">Type of the user</typeparam>
|
|||
public interface ICreationAudited<TUser> : ICreationAudited |
|||
/// <typeparam name="TCreator">Type of the user</typeparam>
|
|||
public interface ICreationAudited<TCreator> : ICreationAudited, IMayHaveCreator<TCreator> |
|||
{ |
|||
/// <summary>
|
|||
/// Reference to the creator user.
|
|||
/// </summary>
|
|||
TUser Creator { get; set; } |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
using System; |
|||
using JetBrains.Annotations; |
|||
|
|||
namespace Volo.Abp.Auditing |
|||
{ |
|||
public interface IMayHaveCreator<TCreator> |
|||
{ |
|||
/// <summary>
|
|||
/// Reference to the creator.
|
|||
/// </summary>
|
|||
[CanBeNull] |
|||
TCreator Creator { get; set; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Standard interface for an entity that MAY have a creator.
|
|||
/// </summary>
|
|||
public interface IMayHaveCreator |
|||
{ |
|||
/// <summary>
|
|||
/// Id of the creator.
|
|||
/// </summary>
|
|||
Guid? CreatorId { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
using System; |
|||
using JetBrains.Annotations; |
|||
|
|||
namespace Volo.Abp.Auditing |
|||
{ |
|||
/// <summary>
|
|||
/// Standard interface for an entity that MUST have a creator of type <typeparamref name="TCreator"/>.
|
|||
/// </summary>
|
|||
public interface IMustHaveCreator<TCreator> : IMustHaveCreator |
|||
{ |
|||
/// <summary>
|
|||
/// Reference to the creator.
|
|||
/// </summary>
|
|||
[NotNull] |
|||
TCreator Creator { get; set; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Standard interface for an entity that MUST have a creator.
|
|||
/// </summary>
|
|||
public interface IMustHaveCreator |
|||
{ |
|||
/// <summary>
|
|||
/// Id of the creator.
|
|||
/// </summary>
|
|||
Guid CreatorId { get; set; } |
|||
} |
|||
} |
|||
Loading…
Reference in new issue