RemotePeer.cs 805 B

1234567891011121314151617181920212223242526272829
  1. using System.ComponentModel.DataAnnotations;
  2. using System.ComponentModel.DataAnnotations.Schema;
  3. using Microsoft.EntityFrameworkCore;
  4. namespace PCC2.Data.Entity;
  5. [Index(nameof(PublicKeyHash), IsUnique = true)]
  6. public class RemotePeer
  7. {
  8. [Key]
  9. [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
  10. public int Id { get; set; }
  11. public int LocalPeerId { get; set; }
  12. public LocalPeer? LocalPeer { get; set; }
  13. [Required][MaxLength(128)][Column(TypeName = "VARCHAR(128)")] public string? Name { get; set; }
  14. [Required][MaxLength(128)][Column(TypeName = "VARCHAR(128)")] public string? Host { get; set; }
  15. [Required]
  16. public int Port { get; set; }
  17. [Required]
  18. public byte[]? PublicKeyHash { get; set; }
  19. [Required]
  20. public byte[]? PublicKey { get; set; }
  21. }