mirror of https://github.com/abpframework/abp.git
csharpabpc-sharpframeworkblazoraspnet-coredotnet-coreaspnetcorearchitecturesaasdomain-driven-designangularmulti-tenancy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.1 KiB
56 lines
1.1 KiB
using System;
|
|
using Volo.Abp.ObjectExtending;
|
|
|
|
namespace Volo.Abp.Application.Dtos;
|
|
|
|
[Serializable]
|
|
public abstract class ExtensibleEntityDto<TKey> : ExtensibleObject, IEntityDto<TKey>
|
|
{
|
|
/// <summary>
|
|
/// Id of the entity.
|
|
/// </summary>
|
|
public TKey Id { get; set; } = default!;
|
|
|
|
protected ExtensibleEntityDto()
|
|
: this(true)
|
|
{
|
|
|
|
}
|
|
|
|
protected ExtensibleEntityDto(bool setDefaultsForExtraProperties)
|
|
: base(setDefaultsForExtraProperties)
|
|
{
|
|
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return $"[DTO: {GetType().Name}] Id = {Id}";
|
|
}
|
|
|
|
public virtual string? GetObjectKey()
|
|
{
|
|
return Id?.ToString();
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public abstract class ExtensibleEntityDto : ExtensibleObject, IEntityDto
|
|
{
|
|
protected ExtensibleEntityDto()
|
|
: this(true)
|
|
{
|
|
|
|
}
|
|
|
|
protected ExtensibleEntityDto(bool setDefaultsForExtraProperties)
|
|
: base(setDefaultsForExtraProperties)
|
|
{
|
|
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return $"[DTO: {GetType().Name}]";
|
|
}
|
|
}
|
|
|