Entity.cs 708 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.ComponentModel.DataAnnotations;
  3. using System.Text;
  4. using Quadarax.Foundation.Core.Data.Interface.Entity;
  5. namespace Quadarax.Foundation.Core.Data.Entity
  6. {
  7. public abstract class Entity<TKey> : IDao<TKey> where TKey : IEquatable<TKey>
  8. {
  9. #region *** Properties ***
  10. [Key]
  11. public virtual TKey Id { get; set; }
  12. #endregion
  13. #region *** Public Overrides ***
  14. public override string ToString()
  15. {
  16. var sb = new StringBuilder();
  17. sb.Append("Entity=").Append(GetType().Name).Append(";Id=").Append(Id);
  18. return sb.ToString();
  19. }
  20. #endregion
  21. }
  22. }