using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace isn.Data.ApiKeys
{
    public class ApiKey
    {
        [Required][Key][DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public string Id { get; set; }

        [Required][ForeignKey("User")]
        public string UserId { get; set; }

        public virtual ApplicationUser User { get; set; }

        public string Name { get; set; }

        public int ValidityPeriodInDays{ get; set; }

        public DateTime CreationDate { get; set; }
    }
}