| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using System;
- namespace Abp.Application.Services.Dto
- {
- /// <summary>
- /// A shortcut of <see cref="EntityDto{TPrimaryKey}"/> for most used primary key type (<see cref="int"/>).
- /// </summary>
- [Serializable]
- public class EntityDto : EntityDto<int>, IEntityDto
- {
- /// <summary>
- /// Creates a new <see cref="EntityDto"/> object.
- /// </summary>
- public EntityDto()
- {
- }
- /// <summary>
- /// Creates a new <see cref="EntityDto"/> object.
- /// </summary>
- /// <param name="id">Id of the entity</param>
- public EntityDto(int id)
- : base(id)
- {
- }
- }
- /// <summary>
- /// Implements common properties for entity based DTOs.
- /// </summary>
- /// <typeparam name="TPrimaryKey">Type of the primary key</typeparam>
- [Serializable]
- public class EntityDto<TPrimaryKey> : IEntityDto<TPrimaryKey>
- {
- /// <summary>
- /// Id of the entity.
- /// </summary>
- public TPrimaryKey Id { get; set; }
- /// <summary>
- /// Creates a new <see cref="EntityDto{TPrimaryKey}"/> object.
- /// </summary>
- public EntityDto()
- {
- }
- /// <summary>
- /// Creates a new <see cref="EntityDto{TPrimaryKey}"/> object.
- /// </summary>
- /// <param name="id">Id of the entity</param>
- public EntityDto(TPrimaryKey id)
- {
- Id = id;
- }
- }
- }
|