using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using API.Entities.Enums; using API.Entities.Interfaces; using Microsoft.EntityFrameworkCore; namespace API.Entities.Metadata { [Index(nameof(Id), nameof(SeriesId), IsUnique = true)] public class SeriesMetadata : IHasConcurrencyToken { public int Id { get; set; } public string Summary { get; set; } public ICollection CollectionTags { get; set; } public ICollection Genres { get; set; } = new List(); /// /// All people attached at a Series level. /// public ICollection People { get; set; } = new List(); /// /// Highest Age Rating from all Chapters /// public AgeRating AgeRating { get; set; } /// /// Earliest Year from all chapters /// public int ReleaseYear { get; set; } // Relationship public Series Series { get; set; } public int SeriesId { get; set; } /// [ConcurrencyCheck] public uint RowVersion { get; private set; } /// public void OnSavingChanges() { RowVersion++; } } }