AyCode.Core/AyCode.Entities/Profiles/AcProfile.cs

42 lines
1.1 KiB
C#

using AyCode.Interfaces.Profiles;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AyCode.Interfaces.Addresses;
namespace AyCode.Entities.Profiles
{
[Table("Profile")]
public abstract class AcProfile<TAddress> : IAcProfile<TAddress> where TAddress : class, IAcAddress
{
protected AcProfile() { }
protected AcProfile(Guid id) : this()
{
Id = id;
}
[Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
public Guid Id { get; set; }
public Guid? UserMediaId { get; set; }
[Required]
public Guid AddressId { get; set; }
[ForeignKey(nameof(AddressId))]
public virtual TAddress Address { get; set; }
[Required]
public string Name { get; set; }
public string? Description { get; set; }
public string? ThumbnailUrl { get ; set; }
public DateTime Created { get; set; }
public DateTime Modified { get; set; }
}
}