mirror of https://github.com/abpframework/abp
#233 DTO audited base classes.
parent
2339fab337
commit
f0870ca427
@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using Volo.Abp.Auditing;
|
||||
|
||||
namespace Volo.Abp.Application.Dtos
|
||||
{
|
||||
/// <summary>
|
||||
/// This class can be inherited by DTO classes to implement <see cref="IAudited"/> interface.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public abstract class AuditedEntityDto : CreationAuditedEntityDto, IAudited
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public DateTime? LastModificationTime { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public long? LastModifierUserId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class can be inherited by DTO classes to implement <see cref="IAudited"/> interface.
|
||||
/// </summary>
|
||||
/// <typeparam name="TPrimaryKey">Type of primary key</typeparam>
|
||||
[Serializable]
|
||||
public abstract class AuditedEntityDto<TPrimaryKey> : CreationAuditedEntityDto<TPrimaryKey>, IAudited
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public DateTime? LastModificationTime { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public long? LastModifierUserId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using Volo.Abp.Auditing;
|
||||
|
||||
namespace Volo.Abp.Application.Dtos
|
||||
{
|
||||
/// <summary>
|
||||
/// This class can be inherited by DTO classes to implement <see cref="IAudited"/> interface.
|
||||
/// </summary>
|
||||
/// <typeparam name="TUserDto">Type of the User DTO</typeparam>
|
||||
[Serializable]
|
||||
public abstract class AuditedEntityWithUserDto<TUserDto> : AuditedEntityDto, IAudited<TUserDto>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public TUserDto CreatorUser { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public TUserDto LastModifierUser { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class can be inherited by DTO classes to implement <see cref="IAudited"/> interface.
|
||||
/// </summary>
|
||||
/// <typeparam name="TPrimaryKey">Type of primary key</typeparam>
|
||||
/// <typeparam name="TUserDto">Type of the User DTO</typeparam>
|
||||
[Serializable]
|
||||
public abstract class AuditedEntityWithUserDto<TPrimaryKey, TUserDto> : AuditedEntityDto<TPrimaryKey>, IAudited<TUserDto>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public TUserDto CreatorUser { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public TUserDto LastModifierUser { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using Volo.Abp.Auditing;
|
||||
|
||||
namespace Volo.Abp.Application.Dtos
|
||||
{
|
||||
/// <summary>
|
||||
/// This class can be inherited by DTO classes to implement <see cref="ICreationAudited"/> interface.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public abstract class CreationAuditedEntityDto : EntityDto, ICreationAudited
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public DateTime CreationTime { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public long? CreatorUserId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class can be inherited by DTO classes to implement <see cref="ICreationAudited"/> interface.
|
||||
/// </summary>
|
||||
/// <typeparam name="TPrimaryKey">Type of primary key</typeparam>
|
||||
[Serializable]
|
||||
public abstract class CreationAuditedEntityDto<TPrimaryKey> : EntityDto<TPrimaryKey>, ICreationAudited
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public DateTime CreationTime { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public long? CreatorUserId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Volo.Abp.Auditing;
|
||||
|
||||
namespace Volo.Abp.Application.Dtos
|
||||
{
|
||||
/// <summary>
|
||||
/// This class can be inherited by DTO classes to implement <see cref="ICreationAudited{TUser}"/> interface.
|
||||
/// </summary>
|
||||
/// <typeparam name="TUserDto">Type of the User DTO</typeparam>
|
||||
[Serializable]
|
||||
public abstract class CreationAuditedEntityWithUserDto<TUserDto> : CreationAuditedEntityDto, ICreationAudited<TUserDto>
|
||||
{
|
||||
public TUserDto CreatorUser { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class can be inherited by DTO classes to implement <see cref="ICreationAudited{TUser}"/> interface.
|
||||
/// </summary>
|
||||
/// <typeparam name="TPrimaryKey">Type of primary key</typeparam>
|
||||
/// <typeparam name="TUserDto">Type of the User DTO</typeparam>
|
||||
[Serializable]
|
||||
public abstract class CreationAuditedEntityWithUserDto<TPrimaryKey, TUserDto> : CreationAuditedEntityDto<TPrimaryKey>, ICreationAudited<TUserDto>
|
||||
{
|
||||
public TUserDto CreatorUser { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using Volo.Abp.Auditing;
|
||||
|
||||
namespace Volo.Abp.Application.Dtos
|
||||
{
|
||||
/// <summary>
|
||||
/// This class can be inherited by DTO classes to implement <see cref="IFullAudited"/> interface.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public abstract class FullAuditedEntityDto : AuditedEntityDto, IFullAudited
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public long? DeleterUserId { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public DateTime? DeletionTime { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class can be inherited by DTO classes to implement <see cref="IFullAudited"/> interface.
|
||||
/// </summary>
|
||||
/// <typeparam name="TPrimaryKey">Type of primary key</typeparam>
|
||||
[Serializable]
|
||||
public abstract class FullAuditedEntityDto<TPrimaryKey> : AuditedEntityDto<TPrimaryKey>, IFullAudited
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public long? DeleterUserId { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public DateTime? DeletionTime { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using Volo.Abp.Auditing;
|
||||
|
||||
namespace Volo.Abp.Application.Dtos
|
||||
{
|
||||
/// <summary>
|
||||
/// This class can be inherited by DTO classes to implement <see cref="IFullAudited{TUser}"/> interface.
|
||||
/// </summary>
|
||||
/// <typeparam name="TUserDto">Type of the User</typeparam>
|
||||
[Serializable]
|
||||
public abstract class FullAuditedEntityWithUserDto<TUserDto> : FullAuditedEntityDto, IFullAudited<TUserDto>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public TUserDto CreatorUser { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public TUserDto LastModifierUser { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public TUserDto DeleterUser { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class can be inherited by DTO classes to implement <see cref="IFullAudited{TUser}"/> interface.
|
||||
/// </summary>
|
||||
/// <typeparam name="TPrimaryKey">Type of primary key</typeparam>
|
||||
/// <typeparam name="TUserDto">Type of the User</typeparam>
|
||||
[Serializable]
|
||||
public abstract class FullAuditedEntityWithUserDto<TPrimaryKey, TUserDto> : FullAuditedEntityDto<TPrimaryKey>, IFullAudited<TUserDto>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public TUserDto CreatorUser { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public TUserDto LastModifierUser { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public TUserDto DeleterUser { get; set; }
|
||||
}
|
||||
}
|
Loading…
Reference in new issue