using System; using System.ComponentModel.DataAnnotations; using Portoa.Persistence; namespace VideoGameQuotes.Api { public class Publisher : Entity, IDtoMappable { public Publisher() { Created = DateTime.UtcNow; } [Required] public virtual string Name { get; set; } public virtual string Website { get; set; } public virtual DateTime Created { get; set; } public virtual PublisherDto ToDto() { return new PublisherDto { Id = Id, Name = Name, Website = Website, Created = Created }; } } public class PublisherDto { public int Id { get; set; } public string Name { get; set; } public string Website { get; set; } public DateTime Created { get; set; } } }