public virtual void MapToEntity(IMovieModel model, ref IMovie entity, int currentDepth = 1) { currentDepth++; // Assign Base properties NameableEntityMapper.MapToEntity(model, ref entity); // Movie Properties entity.HasStaffReview = model.HasStaffReview; entity.Distributor = model.Distributor; entity.BoxOfficeRevenue = model.BoxOfficeRevenue; entity.TotalRevenue = model.TotalRevenue; entity.Budget = model.Budget; entity.Rating = model.Rating; entity.ReleaseDate = model.ReleaseDate; entity.RunTime = model.RunTime; // Related Objects entity.PrimaryImageFileId = model.PrimaryImageFileId; entity.PrimaryImageFile = (ImageFile)model.PrimaryImageFile?.MapToEntity(); // Associated Objects entity.MovieCharacters = model.MovieCharacters?.Where(i => i.Active).Select(MovieCharacterMapperExtensions.MapToEntity).ToList(); entity.MovieConcepts = model.MovieConcepts?.Where(i => i.Active).Select(MovieConceptMapperExtensions.MapToEntity).ToList(); entity.MovieLocations = model.MovieLocations?.Where(i => i.Active).Select(MovieLocationMapperExtensions.MapToEntity).ToList(); entity.MovieObjects = model.MovieObjects?.Where(i => i.Active).Select(MovieObjectMapperExtensions.MapToEntity).ToList(); entity.MovieProducers = model.MovieProducers?.Where(i => i.Active).Select(MovieProducerMapperExtensions.MapToEntity).ToList(); entity.MovieStoryArcs = model.MovieStoryArcs?.Where(i => i.Active).Select(MovieStoryArcMapperExtensions.MapToEntity).ToList(); entity.MovieStudios = model.MovieStudios?.Where(i => i.Active).Select(MovieStudioMapperExtensions.MapToEntity).ToList(); entity.MovieTeams = model.MovieTeams?.Where(i => i.Active).Select(MovieTeamMapperExtensions.MapToEntity).ToList(); entity.MovieWriters = model.MovieWriters?.Where(i => i.Active).Select(MovieWriterMapperExtensions.MapToEntity).ToList(); }
public virtual void MapToEntity(IPersonModel model, ref IPerson entity, int currentDepth = 1) { currentDepth++; // Assign Base properties NameableEntityMapper.MapToEntity(model, ref entity); // Person Properties entity.Hometown = model.Hometown; entity.Country = model.Country; entity.Email = model.Email; entity.Website = model.Website; entity.BirthDate = model.BirthDate; entity.DeathDate = model.DeathDate; // Related Objects entity.PrimaryImageFileId = model.PrimaryImageFileId; entity.PrimaryImageFile = (ImageFile)model.PrimaryImageFile?.MapToEntity(); entity.GenderId = model.GenderId; entity.Gender = (Gender)model.Gender?.MapToEntity(); // Associated Objects entity.CharactersCreated = model.CharactersCreated?.Where(i => i.Active).Select(CreatorCharacterMapperExtensions.MapToEntity).ToList(); entity.PersonAliases = model.PersonAliases?.Where(i => i.Active).Select(PersonAliasMapperExtensions.MapToEntity).ToList(); entity.IssuesWritten = model.IssuesWritten?.Where(i => i.Active).Select(IssueWriterMapperExtensions.MapToEntity).ToList(); entity.MoviesProduced = model.MoviesProduced?.Where(i => i.Active).Select(MovieProducerMapperExtensions.MapToEntity).ToList(); entity.MoviesWritten = model.MoviesWritten?.Where(i => i.Active).Select(MovieWriterMapperExtensions.MapToEntity).ToList(); entity.PromosWritten = model.PromosWritten?.Where(i => i.Active).Select(PromoMapperExtensions.MapToEntity).ToList(); entity.StoryArcsWritten = model.StoryArcsWritten?.Where(i => i.Active).Select(StoryArcWriterMapperExtensions.MapToEntity).ToList(); entity.VolumesWritten = model.VolumesWritten?.Where(i => i.Active).Select(VolumeWriterMapperExtensions.MapToEntity).ToList(); }
public virtual IMovieModel MapToModel(IMovie entity, int currentDepth = 1) { currentDepth++; var model = NameableEntityMapper.MapToModel <IMovie, MovieModel>(entity); // Movie Properties model.HasStaffReview = entity.HasStaffReview; model.Distributor = entity.Distributor; model.BoxOfficeRevenue = entity.BoxOfficeRevenue; model.TotalRevenue = entity.TotalRevenue; model.Budget = entity.Budget; model.Rating = entity.Rating; model.ReleaseDate = entity.ReleaseDate; model.RunTime = entity.RunTime; // Related Objects model.PrimaryImageFileId = entity.PrimaryImageFileId; model.PrimaryImageFile = entity.PrimaryImageFile?.MapToModel(); // Associated Objects model.MovieCharacters = entity.MovieCharacters?.Where(i => i.Active).Select(MovieCharacterMapperExtensions.MapToModelLite).ToList(); model.MovieConcepts = entity.MovieConcepts?.Where(i => i.Active).Select(MovieConceptMapperExtensions.MapToModelLite).ToList(); model.MovieLocations = entity.MovieLocations?.Where(i => i.Active).Select(MovieLocationMapperExtensions.MapToModelLite).ToList(); model.MovieObjects = entity.MovieObjects?.Where(i => i.Active).Select(MovieObjectMapperExtensions.MapToModelLite).ToList(); model.MovieProducers = entity.MovieProducers?.Where(i => i.Active).Select(MovieProducerMapperExtensions.MapToModelLite).ToList(); model.MovieStoryArcs = entity.MovieStoryArcs?.Where(i => i.Active).Select(MovieStoryArcMapperExtensions.MapToModelLite).ToList(); model.MovieStudios = entity.MovieStudios?.Where(i => i.Active).Select(MovieStudioMapperExtensions.MapToModelLite).ToList(); model.MovieTeams = entity.MovieTeams?.Where(i => i.Active).Select(MovieTeamMapperExtensions.MapToModelLite).ToList(); model.MovieWriters = entity.MovieWriters?.Where(i => i.Active).Select(MovieWriterMapperExtensions.MapToModelLite).ToList(); // Return Entity return(model); }
public virtual IPersonModel MapToModel(IPerson entity, int currentDepth = 1) { currentDepth++; var model = NameableEntityMapper.MapToModel <IPerson, PersonModel>(entity); // Person Properties model.Hometown = entity.Hometown; model.Country = entity.Country; model.Email = entity.Email; model.Website = entity.Website; model.BirthDate = entity.BirthDate; model.DeathDate = entity.DeathDate; // Related Objects model.PrimaryImageFileId = entity.PrimaryImageFileId; model.PrimaryImageFile = entity.PrimaryImageFile?.MapToModel(); model.GenderId = entity.GenderId; model.Gender = entity.Gender?.MapToModel(); // Associated Objects model.CharactersCreated = entity.CharactersCreated?.Where(i => i.Active).Select(CreatorCharacterMapperExtensions.MapToModelLite).ToList(); model.PersonAliases = entity.PersonAliases?.Where(i => i.Active).Select(PersonAliasMapperExtensions.MapToModelLite).ToList(); model.IssuesWritten = entity.IssuesWritten?.Where(i => i.Active).Select(IssueWriterMapperExtensions.MapToModelLite).ToList(); model.MoviesProduced = entity.MoviesProduced?.Where(i => i.Active).Select(MovieProducerMapperExtensions.MapToModelLite).ToList(); model.MoviesWritten = entity.MoviesWritten?.Where(i => i.Active).Select(MovieWriterMapperExtensions.MapToModelLite).ToList(); model.PromosWritten = entity.PromosWritten?.Where(i => i.Active).Select(PromoMapperExtensions.MapToModelLite).ToList(); model.StoryArcsWritten = entity.StoryArcsWritten?.Where(i => i.Active).Select(StoryArcWriterMapperExtensions.MapToModelLite).ToList(); model.VolumesWritten = entity.VolumesWritten?.Where(i => i.Active).Select(VolumeWriterMapperExtensions.MapToModelLite).ToList(); // Return Entity return(model); }
public virtual void MapToEntity(ICharacterModel model, ref ICharacter entity, int currentDepth = 1) { currentDepth++; // Assign Base properties NameableEntityMapper.MapToEntity(model, ref entity); // Character Properties entity.RealName = model.RealName; entity.DateOfBirth = model.DateOfBirth; // Related Objects entity.PrimaryImageFileId = model.PrimaryImageFileId; entity.PrimaryImageFile = (ImageFile)model.PrimaryImageFile?.MapToEntity(); entity.FirstIssueAppearanceId = model.FirstIssueAppearanceId; entity.FirstIssueAppearance = (Issue)model.FirstIssueAppearance?.MapToEntity(); entity.GenderId = model.GenderId; entity.Gender = (Gender)model.Gender?.MapToEntity(); entity.OriginId = model.OriginId; entity.Origin = (Origin)model.Origin?.MapToEntity(); entity.PublisherId = model.PublisherId; entity.Publisher = (Publisher)model.Publisher?.MapToEntity(); // Associated Objects entity.CharacterAliases = model.CharacterAliases?.Where(i => i.Active).Select(CharacterAliasMapperExtensions.MapToEntity).ToList(); entity.CharacterCreators = model.CharacterCreators?.Where(i => i.Active).Select(CharacterCreatorMapperExtensions.MapToEntity).ToList(); entity.CharacterEnemies = model.CharacterEnemies?.Where(i => i.Active).Select(CharacterEnemyMapperExtensions.MapToEntity).ToList(); entity.CharacterEnemyTeams = model.CharacterEnemyTeams?.Where(i => i.Active).Select(CharacterEnemyTeamMapperExtensions.MapToEntity).ToList(); entity.CharacterFriends = model.CharacterFriends?.Where(i => i.Active).Select(CharacterFriendMapperExtensions.MapToEntity).ToList(); entity.CharacterFriendlyTeams = model.CharacterFriendlyTeams?.Where(i => i.Active).Select(CharacterFriendlyTeamMapperExtensions.MapToEntity).ToList(); entity.CharacterIssuesAppearedIn = model.CharacterIssuesAppearedIn?.Where(i => i.Active).Select(CharacterAppearedInIssueMapperExtensions.MapToEntity).ToList(); entity.CharacterIssuesDiedIn = model.CharacterIssuesDiedIn?.Where(i => i.Active).Select(CharacterDiedInIssueMapperExtensions.MapToEntity).ToList(); entity.CharacterIssues = model.CharacterIssues?.Where(i => i.Active).Select(CharacterIssueMapperExtensions.MapToEntity).ToList(); entity.CharacterMovies = model.CharacterMovies?.Where(i => i.Active).Select(CharacterMovieMapperExtensions.MapToEntity).ToList(); entity.CharacterPowers = model.CharacterPowers?.Where(i => i.Active).Select(CharacterPowerMapperExtensions.MapToEntity).ToList(); entity.CharacterStoryArcs = model.CharacterStoryArcs?.Where(i => i.Active).Select(CharacterStoryArcMapperExtensions.MapToEntity).ToList(); entity.CharacterTeams = model.CharacterTeams?.Where(i => i.Active).Select(CharacterTeamMapperExtensions.MapToEntity).ToList(); entity.CharacterVolumes = model.CharacterVolumes?.Where(i => i.Active).Select(CharacterVolumeMapperExtensions.MapToEntity).ToList(); }
public virtual void MapToEntity(IVolumeModel model, ref IVolume entity, int currentDepth = 1) { currentDepth++; // Assign Base properties NameableEntityMapper.MapToEntity(model, ref entity); // Volume Properties entity.Startyear = model.Startyear; // Related Objects entity.PrimaryImageFileId = model.PrimaryImageFileId; entity.PrimaryImageFile = (ImageFile)model.PrimaryImageFile?.MapToEntity(); entity.FirstIssueId = model.FirstIssueId; entity.FirstIssue = (Issue)model.FirstIssue?.MapToEntity(); entity.LastIssueId = model.LastIssueId; entity.LastIssue = (Issue)model.LastIssue?.MapToEntity(); entity.PublisherId = model.PublisherId; entity.Publisher = (Publisher)model.Publisher?.MapToEntity(); // Associated Objects entity.Issues = model.Issues?.Where(i => i.Active).Select(IssueMapperExtensions.MapToEntity).ToList(); entity.VolumeAliases = model.VolumeAliases?.Where(i => i.Active).Select(VolumeAliasMapperExtensions.MapToEntity).ToList(); entity.VolumeCharacters = model.VolumeCharacters?.Where(i => i.Active).Select(VolumeCharacterMapperExtensions.MapToEntity).ToList(); entity.VolumeConcepts = model.VolumeConcepts?.Where(i => i.Active).Select(VolumeConceptMapperExtensions.MapToEntity).ToList(); entity.VolumeLocations = model.VolumeLocations?.Where(i => i.Active).Select(VolumeLocationMapperExtensions.MapToEntity).ToList(); entity.VolumeObjects = model.VolumeObjects?.Where(i => i.Active).Select(VolumeObjectMapperExtensions.MapToEntity).ToList(); entity.VolumeTeams = model.VolumeTeams?.Where(i => i.Active).Select(VolumeTeamMapperExtensions.MapToEntity).ToList(); entity.VolumeWriters = model.VolumeWriters?.Where(i => i.Active).Select(VolumeWriterMapperExtensions.MapToEntity).ToList(); }
public virtual IImageFileModel MapToModel(IImageFile entity, int currentDepth = 1) { currentDepth++; var model = NameableEntityMapper.MapToModel <IImageFile, ImageFileModel>(entity); // ImageFile Properties // <None> // Related Objects // <None> // Associated Objects model.Characters = entity.Characters?.Where(i => i.Active).Select(CharacterMapperExtensions.MapToModelLite).ToList(); model.Chats = entity.Chats?.Where(i => i.Active).Select(ChatMapperExtensions.MapToModelLite).ToList(); model.Concepts = entity.Concepts?.Where(i => i.Active).Select(ConceptMapperExtensions.MapToModelLite).ToList(); model.Episodes = entity.Episodes?.Where(i => i.Active).Select(EpisodeMapperExtensions.MapToModelLite).ToList(); model.Issues = entity.Issues?.Where(i => i.Active).Select(IssueMapperExtensions.MapToModelLite).ToList(); model.Locations = entity.Locations?.Where(i => i.Active).Select(LocationMapperExtensions.MapToModelLite).ToList(); model.Movies = entity.Movies?.Where(i => i.Active).Select(MovieMapperExtensions.MapToModelLite).ToList(); model.Objects = entity.Objects?.Where(i => i.Active).Select(ObjectMapperExtensions.MapToModelLite).ToList(); model.People = entity.People?.Where(i => i.Active).Select(PersonMapperExtensions.MapToModelLite).ToList(); model.Promos = entity.Promos?.Where(i => i.Active).Select(PromoMapperExtensions.MapToModelLite).ToList(); model.Publishers = entity.Publishers?.Where(i => i.Active).Select(PublisherMapperExtensions.MapToModelLite).ToList(); model.StoryArcs = entity.StoryArcs?.Where(i => i.Active).Select(StoryArcMapperExtensions.MapToModelLite).ToList(); model.Teams = entity.Teams?.Where(i => i.Active).Select(TeamMapperExtensions.MapToModelLite).ToList(); model.Videos = entity.Videos?.Where(i => i.Active).Select(VideoMapperExtensions.MapToModelLite).ToList(); model.Volumes = entity.Volumes?.Where(i => i.Active).Select(VolumeMapperExtensions.MapToModelLite).ToList(); // Return Entity return(model); }
public virtual ISeriesSearchModel MapToSearchModel(ISeriesModel model) { var searchModel = NameableEntityMapper.MapToSearchModel <ISeriesModel, SeriesSearchModel>(model); // Search Properties searchModel.PublisherId = model.PublisherId; searchModel.PublisherCustomKey = model.Publisher?.CustomKey; searchModel.PublisherApiDetailUrl = model.Publisher?.ApiDetailUrl; searchModel.PublisherSiteDetailUrl = model.Publisher?.SiteDetailUrl; searchModel.PublisherName = model.Publisher?.Name; searchModel.PublisherShortDescription = model.Publisher?.ShortDescription; searchModel.PublisherDescription = model.Publisher?.Description; searchModel.FirstEpisodeId = model.FirstEpisodeId; searchModel.FirstEpisodeCustomKey = model.FirstEpisode?.CustomKey; searchModel.FirstEpisodeApiDetailUrl = model.FirstEpisode?.ApiDetailUrl; searchModel.FirstEpisodeSiteDetailUrl = model.FirstEpisode?.SiteDetailUrl; searchModel.FirstEpisodeName = model.FirstEpisode?.Name; searchModel.FirstEpisodeShortDescription = model.FirstEpisode?.ShortDescription; searchModel.FirstEpisodeDescription = model.FirstEpisode?.Description; searchModel.LastEpisodeId = model.LastEpisodeId; searchModel.LastEpisodeCustomKey = model.LastEpisode?.CustomKey; searchModel.LastEpisodeApiDetailUrl = model.LastEpisode?.ApiDetailUrl; searchModel.LastEpisodeSiteDetailUrl = model.LastEpisode?.SiteDetailUrl; searchModel.LastEpisodeName = model.LastEpisode?.Name; searchModel.LastEpisodeShortDescription = model.LastEpisode?.ShortDescription; searchModel.LastEpisodeDescription = model.LastEpisode?.Description; // Return Search Model return(searchModel); }
public virtual IEpisode MapToEntity(IEpisodeModel model, int currentDepth = 1) { currentDepth++; var entity = NameableEntityMapper.MapToEntity <Episode, IEpisodeModel>(model); // Episode Properties entity.HasStaffReview = model.HasStaffReview; entity.AirDate = model.AirDate; entity.EpisodeCode = model.EpisodeCode; entity.SeasonNumber = model.SeasonNumber; entity.EpisodeNumber = model.EpisodeNumber; // Related Objects entity.PrimaryImageFileId = model.PrimaryImageFileId; entity.PrimaryImageFile = (ImageFile)model.PrimaryImageFile?.MapToEntity(); entity.SeriesId = model.SeriesId; entity.Series = (Series)model.Series?.MapToEntity(); // Associated Objects entity.EpisodeAliases = model.EpisodeAliases?.Where(i => i.Active).Select(EpisodeAliasMapperExtensions.MapToEntity).Cast <EpisodeAlias>().ToList(); entity.EpisodeCharacters = model.EpisodeCharacters?.Where(i => i.Active).Select(EpisodeCharacterMapperExtensions.MapToEntity).Cast <EpisodeCharacter>().ToList(); entity.EpisodeCharactersDied = model.EpisodeCharactersDied?.Where(i => i.Active).Select(EpisodeCharacterDiedMapperExtensions.MapToEntity).Cast <EpisodeCharacterDied>().ToList(); entity.EpisodeCharacterFirstAppearances = model.EpisodeCharacterFirstAppearances?.Where(i => i.Active).Select(EpisodeCharacterFirstAppearanceMapperExtensions.MapToEntity).Cast <EpisodeCharacterFirstAppearance>().ToList(); entity.EpisodeConcepts = model.EpisodeConcepts?.Where(i => i.Active).Select(EpisodeConceptMapperExtensions.MapToEntity).Cast <EpisodeConcept>().ToList(); entity.EpisodeConceptFirstAppearances = model.EpisodeConceptFirstAppearances?.Where(i => i.Active).Select(EpisodeConceptFirstAppearanceMapperExtensions.MapToEntity).Cast <EpisodeConceptFirstAppearance>().ToList(); entity.EpisodeLocations = model.EpisodeLocations?.Where(i => i.Active).Select(EpisodeLocationMapperExtensions.MapToEntity).Cast <EpisodeLocation>().ToList(); entity.EpisodeLocationFirstAppearances = model.EpisodeLocationFirstAppearances?.Where(i => i.Active).Select(EpisodeLocationFirstAppearanceMapperExtensions.MapToEntity).Cast <EpisodeLocationFirstAppearance>().ToList(); entity.EpisodeObjects = model.EpisodeObjects?.Where(i => i.Active).Select(EpisodeObjectMapperExtensions.MapToEntity).Cast <EpisodeObject>().ToList(); entity.EpisodeObjectFirstAppearances = model.EpisodeObjectFirstAppearances?.Where(i => i.Active).Select(EpisodeObjectFirstAppearanceMapperExtensions.MapToEntity).Cast <EpisodeObjectFirstAppearance>().ToList(); entity.EpisodePeople = model.EpisodePeople?.Where(i => i.Active).Select(EpisodePersonMapperExtensions.MapToEntity).Cast <EpisodePerson>().ToList(); entity.EpisodeStoryArcs = model.EpisodeStoryArcs?.Where(i => i.Active).Select(EpisodeStoryArcMapperExtensions.MapToEntity).Cast <EpisodeStoryArc>().ToList(); entity.EpisodeStoryArcFirstAppearances = model.EpisodeStoryArcFirstAppearances?.Where(i => i.Active).Select(EpisodeStoryArcFirstAppearanceMapperExtensions.MapToEntity).Cast <EpisodeStoryArcFirstAppearance>().ToList(); entity.EpisodeTeams = model.EpisodeTeams?.Where(i => i.Active).Select(EpisodeTeamMapperExtensions.MapToEntity).Cast <EpisodeTeam>().ToList(); entity.EpisodeTeamFirstAppearances = model.EpisodeTeamFirstAppearances?.Where(i => i.Active).Select(EpisodeTeamFirstAppearanceMapperExtensions.MapToEntity).Cast <EpisodeTeamFirstAppearance>().ToList(); // Return Entity return(entity); }
public virtual IEpisodeModel MapToModel(IEpisode entity, int currentDepth = 1) { currentDepth++; var model = NameableEntityMapper.MapToModel <IEpisode, EpisodeModel>(entity); // Episode Properties model.HasStaffReview = entity.HasStaffReview; model.AirDate = entity.AirDate; model.EpisodeCode = entity.EpisodeCode; model.SeasonNumber = entity.SeasonNumber; model.EpisodeNumber = entity.EpisodeNumber; // Related Objects model.PrimaryImageFileId = entity.PrimaryImageFileId; model.PrimaryImageFile = entity.PrimaryImageFile?.MapToModel(); model.SeriesId = entity.SeriesId; model.Series = entity.Series?.MapToModel(); // Associated Objects model.EpisodeAliases = entity.EpisodeAliases?.Where(i => i.Active).Select(EpisodeAliasMapperExtensions.MapToModelLite).ToList(); model.EpisodeCharacters = entity.EpisodeCharacters?.Where(i => i.Active).Select(EpisodeCharacterMapperExtensions.MapToModelLite).ToList(); model.EpisodeCharactersDied = entity.EpisodeCharactersDied?.Where(i => i.Active).Select(EpisodeCharacterDiedMapperExtensions.MapToModelLite).ToList(); model.EpisodeCharacterFirstAppearances = entity.EpisodeCharacterFirstAppearances?.Where(i => i.Active).Select(EpisodeCharacterFirstAppearanceMapperExtensions.MapToModelLite).ToList(); model.EpisodeConcepts = entity.EpisodeConcepts?.Where(i => i.Active).Select(EpisodeConceptMapperExtensions.MapToModelLite).ToList(); model.EpisodeConceptFirstAppearances = entity.EpisodeConceptFirstAppearances?.Where(i => i.Active).Select(EpisodeConceptFirstAppearanceMapperExtensions.MapToModelLite).ToList(); model.EpisodeLocations = entity.EpisodeLocations?.Where(i => i.Active).Select(EpisodeLocationMapperExtensions.MapToModelLite).ToList(); model.EpisodeLocationFirstAppearances = entity.EpisodeLocationFirstAppearances?.Where(i => i.Active).Select(EpisodeLocationFirstAppearanceMapperExtensions.MapToModelLite).ToList(); model.EpisodeObjects = entity.EpisodeObjects?.Where(i => i.Active).Select(EpisodeObjectMapperExtensions.MapToModelLite).ToList(); model.EpisodeObjectFirstAppearances = entity.EpisodeObjectFirstAppearances?.Where(i => i.Active).Select(EpisodeObjectFirstAppearanceMapperExtensions.MapToModelLite).ToList(); model.EpisodePeople = entity.EpisodePeople?.Where(i => i.Active).Select(EpisodePersonMapperExtensions.MapToModelLite).ToList(); model.EpisodeStoryArcs = entity.EpisodeStoryArcs?.Where(i => i.Active).Select(EpisodeStoryArcMapperExtensions.MapToModelLite).ToList(); model.EpisodeStoryArcFirstAppearances = entity.EpisodeStoryArcFirstAppearances?.Where(i => i.Active).Select(EpisodeStoryArcFirstAppearanceMapperExtensions.MapToModelLite).ToList(); model.EpisodeTeams = entity.EpisodeTeams?.Where(i => i.Active).Select(EpisodeTeamMapperExtensions.MapToModelLite).ToList(); model.EpisodeTeamFirstAppearances = entity.EpisodeTeamFirstAppearances?.Where(i => i.Active).Select(EpisodeTeamFirstAppearanceMapperExtensions.MapToModelLite).ToList(); // Return Entity return(model); }
public virtual IVolumeModel MapToModel(IVolume entity, int currentDepth = 1) { currentDepth++; var model = NameableEntityMapper.MapToModel <IVolume, VolumeModel>(entity); // Volume Properties model.Startyear = entity.Startyear; // Related Objects model.PrimaryImageFileId = entity.PrimaryImageFileId; model.PrimaryImageFile = entity.PrimaryImageFile?.MapToModel(); model.FirstIssueId = entity.FirstIssueId; model.FirstIssue = entity.FirstIssue?.MapToModel(); model.LastIssueId = entity.LastIssueId; model.LastIssue = entity.LastIssue?.MapToModel(); model.PublisherId = entity.PublisherId; model.Publisher = entity.Publisher?.MapToModel(); // Associated Objects model.Issues = entity.Issues?.Where(i => i.Active).Select(IssueMapperExtensions.MapToModelLite).ToList(); model.VolumeAliases = entity.VolumeAliases?.Where(i => i.Active).Select(VolumeAliasMapperExtensions.MapToModelLite).ToList(); model.VolumeCharacters = entity.VolumeCharacters?.Where(i => i.Active).Select(VolumeCharacterMapperExtensions.MapToModelLite).ToList(); model.VolumeConcepts = entity.VolumeConcepts?.Where(i => i.Active).Select(VolumeConceptMapperExtensions.MapToModelLite).ToList(); model.VolumeLocations = entity.VolumeLocations?.Where(i => i.Active).Select(VolumeLocationMapperExtensions.MapToModelLite).ToList(); model.VolumeObjects = entity.VolumeObjects?.Where(i => i.Active).Select(VolumeObjectMapperExtensions.MapToModelLite).ToList(); model.VolumeTeams = entity.VolumeTeams?.Where(i => i.Active).Select(VolumeTeamMapperExtensions.MapToModelLite).ToList(); model.VolumeWriters = entity.VolumeWriters?.Where(i => i.Active).Select(VolumeWriterMapperExtensions.MapToModelLite).ToList(); // Return Entity return(model); }
public virtual ITeamSearchModel MapToSearchModel(ITeamModel model) { var searchModel = NameableEntityMapper.MapToSearchModel <ITeamModel, TeamSearchModel>(model); // Search Properties searchModel.PrimaryImageFileId = model.PrimaryImageFileId; searchModel.PrimaryImageFileCustomKey = model.PrimaryImageFile?.CustomKey; searchModel.PrimaryImageFileApiDetailUrl = model.PrimaryImageFile?.ApiDetailUrl; searchModel.PrimaryImageFileSiteDetailUrl = model.PrimaryImageFile?.SiteDetailUrl; searchModel.PrimaryImageFileName = model.PrimaryImageFile?.Name; searchModel.PrimaryImageFileShortDescription = model.PrimaryImageFile?.ShortDescription; searchModel.PrimaryImageFileDescription = model.PrimaryImageFile?.Description; searchModel.FirstIssueAppearanceId = model.FirstIssueAppearanceId; searchModel.FirstIssueAppearanceCustomKey = model.FirstIssueAppearance?.CustomKey; searchModel.FirstIssueAppearanceApiDetailUrl = model.FirstIssueAppearance?.ApiDetailUrl; searchModel.FirstIssueAppearanceSiteDetailUrl = model.FirstIssueAppearance?.SiteDetailUrl; searchModel.FirstIssueAppearanceName = model.FirstIssueAppearance?.Name; searchModel.FirstIssueAppearanceShortDescription = model.FirstIssueAppearance?.ShortDescription; searchModel.FirstIssueAppearanceDescription = model.FirstIssueAppearance?.Description; searchModel.PublisherId = model.PublisherId; searchModel.PublisherCustomKey = model.Publisher?.CustomKey; searchModel.PublisherApiDetailUrl = model.Publisher?.ApiDetailUrl; searchModel.PublisherSiteDetailUrl = model.Publisher?.SiteDetailUrl; searchModel.PublisherName = model.Publisher?.Name; searchModel.PublisherShortDescription = model.Publisher?.ShortDescription; searchModel.PublisherDescription = model.Publisher?.Description; // Return Search Model return(searchModel); }
public virtual IVideoSearchModel MapToSearchModel(IVideoModel model) { var searchModel = NameableEntityMapper.MapToSearchModel <IVideoModel, VideoSearchModel>(model); // Search Properties searchModel.PrimaryImageFileId = model.PrimaryImageFileId; searchModel.PrimaryImageFileCustomKey = model.PrimaryImageFile?.CustomKey; searchModel.PrimaryImageFileApiDetailUrl = model.PrimaryImageFile?.ApiDetailUrl; searchModel.PrimaryImageFileSiteDetailUrl = model.PrimaryImageFile?.SiteDetailUrl; searchModel.PrimaryImageFileName = model.PrimaryImageFile?.Name; searchModel.PrimaryImageFileShortDescription = model.PrimaryImageFile?.ShortDescription; searchModel.PrimaryImageFileDescription = model.PrimaryImageFile?.Description; searchModel.AuthorId = model.AuthorId; searchModel.AuthorCustomKey = model.Author?.CustomKey; searchModel.AuthorApiDetailUrl = model.Author?.ApiDetailUrl; searchModel.AuthorSiteDetailUrl = model.Author?.SiteDetailUrl; searchModel.AuthorName = model.Author?.Name; searchModel.AuthorShortDescription = model.Author?.ShortDescription; searchModel.AuthorDescription = model.Author?.Description; searchModel.VideoTypeId = model.VideoTypeId; searchModel.VideoTypeCustomKey = model.VideoType?.CustomKey; searchModel.VideoTypeApiDetailUrl = model.VideoType?.ApiDetailUrl; searchModel.VideoTypeSiteDetailUrl = model.VideoType?.SiteDetailUrl; searchModel.VideoTypeName = model.VideoType?.Name; searchModel.VideoTypeShortDescription = model.VideoType?.ShortDescription; searchModel.VideoTypeDescription = model.VideoType?.Description; // Return Search Model return(searchModel); }
public virtual void MapToEntity(ITeamModel model, ref ITeam entity, int currentDepth = 1) { currentDepth++; // Assign Base properties NameableEntityMapper.MapToEntity(model, ref entity); // Team Properties // <None> // Related Objects entity.PrimaryImageFileId = model.PrimaryImageFileId; entity.PrimaryImageFile = (ImageFile)model.PrimaryImageFile?.MapToEntity(); entity.FirstIssueAppearanceId = model.FirstIssueAppearanceId; entity.FirstIssueAppearance = (Issue)model.FirstIssueAppearance?.MapToEntity(); entity.PublisherId = model.PublisherId; entity.Publisher = (Publisher)model.Publisher?.MapToEntity(); // Associated Objects entity.TeamAliases = model.TeamAliases?.Where(i => i.Active).Select(TeamAliasMapperExtensions.MapToEntity).ToList(); entity.TeamCharacterEnemies = model.TeamCharacterEnemies?.Where(i => i.Active).Select(TeamCharacterEnemyMapperExtensions.MapToEntity).ToList(); entity.TeamCharacterFriends = model.TeamCharacterFriends?.Where(i => i.Active).Select(TeamCharacterFriendMapperExtensions.MapToEntity).ToList(); entity.TeamIssuesAppearedIn = model.TeamIssuesAppearedIn?.Where(i => i.Active).Select(TeamAppearedInIssueMapperExtensions.MapToEntity).ToList(); entity.TeamIssuesDisbandedIn = model.TeamIssuesDisbandedIn?.Where(i => i.Active).Select(TeamDisbandedInIssueMapperExtensions.MapToEntity).ToList(); entity.TeamIssues = model.TeamIssues?.Where(i => i.Active).Select(TeamIssueMapperExtensions.MapToEntity).ToList(); entity.TeamMembers = model.TeamMembers?.Where(i => i.Active).Select(TeamMemberMapperExtensions.MapToEntity).ToList(); entity.TeamMovies = model.TeamMovies?.Where(i => i.Active).Select(TeamMovieMapperExtensions.MapToEntity).ToList(); entity.TeamStoryArcs = model.TeamStoryArcs?.Where(i => i.Active).Select(TeamStoryArcMapperExtensions.MapToEntity).ToList(); entity.TeamVolumes = model.TeamVolumes?.Where(i => i.Active).Select(TeamVolumeMapperExtensions.MapToEntity).ToList(); }
public virtual IVolume MapToEntity(IVolumeModel model, int currentDepth = 1) { currentDepth++; var entity = NameableEntityMapper.MapToEntity <Volume, IVolumeModel>(model); // Volume Properties entity.Startyear = model.Startyear; // Related Objects entity.PrimaryImageFileId = model.PrimaryImageFileId; entity.PrimaryImageFile = (ImageFile)model.PrimaryImageFile?.MapToEntity(); entity.FirstIssueId = model.FirstIssueId; entity.FirstIssue = (Issue)model.FirstIssue?.MapToEntity(); entity.LastIssueId = model.LastIssueId; entity.LastIssue = (Issue)model.LastIssue?.MapToEntity(); entity.PublisherId = model.PublisherId; entity.Publisher = (Publisher)model.Publisher?.MapToEntity(); // Associated Objects entity.Issues = model.Issues?.Where(i => i.Active).Select(IssueMapperExtensions.MapToEntity).Cast <Issue>().ToList(); entity.VolumeAliases = model.VolumeAliases?.Where(i => i.Active).Select(VolumeAliasMapperExtensions.MapToEntity).Cast <VolumeAlias>().ToList(); entity.VolumeCharacters = model.VolumeCharacters?.Where(i => i.Active).Select(VolumeCharacterMapperExtensions.MapToEntity).Cast <VolumeCharacter>().ToList(); entity.VolumeConcepts = model.VolumeConcepts?.Where(i => i.Active).Select(VolumeConceptMapperExtensions.MapToEntity).Cast <VolumeConcept>().ToList(); entity.VolumeLocations = model.VolumeLocations?.Where(i => i.Active).Select(VolumeLocationMapperExtensions.MapToEntity).Cast <VolumeLocation>().ToList(); entity.VolumeObjects = model.VolumeObjects?.Where(i => i.Active).Select(VolumeObjectMapperExtensions.MapToEntity).Cast <VolumeObject>().ToList(); entity.VolumeTeams = model.VolumeTeams?.Where(i => i.Active).Select(VolumeTeamMapperExtensions.MapToEntity).Cast <VolumeTeam>().ToList(); entity.VolumeWriters = model.VolumeWriters?.Where(i => i.Active).Select(VolumeWriterMapperExtensions.MapToEntity).Cast <VolumeWriter>().ToList(); // Return Entity return(entity); }
public virtual void MapToEntity(IImageFileModel model, ref IImageFile entity, int currentDepth = 1) { currentDepth++; // Assign Base properties NameableEntityMapper.MapToEntity(model, ref entity); // ImageFile Properties // <None> // Related Objects // <None> // Associated Objects entity.Characters = model.Characters?.Where(i => i.Active).Select(CharacterMapperExtensions.MapToEntity).ToList(); entity.Chats = model.Chats?.Where(i => i.Active).Select(ChatMapperExtensions.MapToEntity).ToList(); entity.Concepts = model.Concepts?.Where(i => i.Active).Select(ConceptMapperExtensions.MapToEntity).ToList(); entity.Episodes = model.Episodes?.Where(i => i.Active).Select(EpisodeMapperExtensions.MapToEntity).ToList(); entity.Issues = model.Issues?.Where(i => i.Active).Select(IssueMapperExtensions.MapToEntity).ToList(); entity.Locations = model.Locations?.Where(i => i.Active).Select(LocationMapperExtensions.MapToEntity).ToList(); entity.Movies = model.Movies?.Where(i => i.Active).Select(MovieMapperExtensions.MapToEntity).ToList(); entity.Objects = model.Objects?.Where(i => i.Active).Select(ObjectMapperExtensions.MapToEntity).ToList(); entity.People = model.People?.Where(i => i.Active).Select(PersonMapperExtensions.MapToEntity).ToList(); entity.Promos = model.Promos?.Where(i => i.Active).Select(PromoMapperExtensions.MapToEntity).ToList(); entity.Publishers = model.Publishers?.Where(i => i.Active).Select(PublisherMapperExtensions.MapToEntity).ToList(); entity.StoryArcs = model.StoryArcs?.Where(i => i.Active).Select(StoryArcMapperExtensions.MapToEntity).ToList(); entity.Teams = model.Teams?.Where(i => i.Active).Select(TeamMapperExtensions.MapToEntity).ToList(); entity.Videos = model.Videos?.Where(i => i.Active).Select(VideoMapperExtensions.MapToEntity).ToList(); entity.Volumes = model.Volumes?.Where(i => i.Active).Select(VolumeMapperExtensions.MapToEntity).ToList(); }
public virtual IImageFile MapToEntity(IImageFileModel model, int currentDepth = 1) { currentDepth++; var entity = NameableEntityMapper.MapToEntity <ImageFile, IImageFileModel>(model); // ImageFile Properties // <None> // Related Objects // <None> // Associated Objects entity.Characters = model.Characters?.Where(i => i.Active).Select(CharacterMapperExtensions.MapToEntity).Cast <Character>().ToList(); entity.Chats = model.Chats?.Where(i => i.Active).Select(ChatMapperExtensions.MapToEntity).Cast <Chat>().ToList(); entity.Concepts = model.Concepts?.Where(i => i.Active).Select(ConceptMapperExtensions.MapToEntity).Cast <Concept>().ToList(); entity.Episodes = model.Episodes?.Where(i => i.Active).Select(EpisodeMapperExtensions.MapToEntity).Cast <Episode>().ToList(); entity.Issues = model.Issues?.Where(i => i.Active).Select(IssueMapperExtensions.MapToEntity).Cast <Issue>().ToList(); entity.Locations = model.Locations?.Where(i => i.Active).Select(LocationMapperExtensions.MapToEntity).Cast <Location>().ToList(); entity.Movies = model.Movies?.Where(i => i.Active).Select(MovieMapperExtensions.MapToEntity).Cast <Movie>().ToList(); entity.Objects = model.Objects?.Where(i => i.Active).Select(ObjectMapperExtensions.MapToEntity).Cast <Object>().ToList(); entity.People = model.People?.Where(i => i.Active).Select(PersonMapperExtensions.MapToEntity).Cast <Person>().ToList(); entity.Promos = model.Promos?.Where(i => i.Active).Select(PromoMapperExtensions.MapToEntity).Cast <Promo>().ToList(); entity.Publishers = model.Publishers?.Where(i => i.Active).Select(PublisherMapperExtensions.MapToEntity).Cast <Publisher>().ToList(); entity.StoryArcs = model.StoryArcs?.Where(i => i.Active).Select(StoryArcMapperExtensions.MapToEntity).Cast <StoryArc>().ToList(); entity.Teams = model.Teams?.Where(i => i.Active).Select(TeamMapperExtensions.MapToEntity).Cast <Team>().ToList(); entity.Videos = model.Videos?.Where(i => i.Active).Select(VideoMapperExtensions.MapToEntity).Cast <Video>().ToList(); entity.Volumes = model.Volumes?.Where(i => i.Active).Select(VolumeMapperExtensions.MapToEntity).Cast <Volume>().ToList(); // Return Entity return(entity); }
public virtual ITeamModel MapToModel(ITeam entity, int currentDepth = 1) { currentDepth++; var model = NameableEntityMapper.MapToModel <ITeam, TeamModel>(entity); // Team Properties // <None> // Related Objects model.PrimaryImageFileId = entity.PrimaryImageFileId; model.PrimaryImageFile = entity.PrimaryImageFile?.MapToModel(); model.FirstIssueAppearanceId = entity.FirstIssueAppearanceId; model.FirstIssueAppearance = entity.FirstIssueAppearance?.MapToModel(); model.PublisherId = entity.PublisherId; model.Publisher = entity.Publisher?.MapToModel(); // Associated Objects model.TeamAliases = entity.TeamAliases?.Where(i => i.Active).Select(TeamAliasMapperExtensions.MapToModelLite).ToList(); model.TeamCharacterEnemies = entity.TeamCharacterEnemies?.Where(i => i.Active).Select(TeamCharacterEnemyMapperExtensions.MapToModelLite).ToList(); model.TeamCharacterFriends = entity.TeamCharacterFriends?.Where(i => i.Active).Select(TeamCharacterFriendMapperExtensions.MapToModelLite).ToList(); model.TeamIssuesAppearedIn = entity.TeamIssuesAppearedIn?.Where(i => i.Active).Select(TeamAppearedInIssueMapperExtensions.MapToModelLite).ToList(); model.TeamIssuesDisbandedIn = entity.TeamIssuesDisbandedIn?.Where(i => i.Active).Select(TeamDisbandedInIssueMapperExtensions.MapToModelLite).ToList(); model.TeamIssues = entity.TeamIssues?.Where(i => i.Active).Select(TeamIssueMapperExtensions.MapToModelLite).ToList(); model.TeamMembers = entity.TeamMembers?.Where(i => i.Active).Select(TeamMemberMapperExtensions.MapToModelLite).ToList(); model.TeamMovies = entity.TeamMovies?.Where(i => i.Active).Select(TeamMovieMapperExtensions.MapToModelLite).ToList(); model.TeamStoryArcs = entity.TeamStoryArcs?.Where(i => i.Active).Select(TeamStoryArcMapperExtensions.MapToModelLite).ToList(); model.TeamVolumes = entity.TeamVolumes?.Where(i => i.Active).Select(TeamVolumeMapperExtensions.MapToModelLite).ToList(); // Return Entity return(model); }
public virtual IOriginSearchModel MapToSearchModel(IOriginModel model) { var searchModel = NameableEntityMapper.MapToSearchModel <IOriginModel, OriginSearchModel>(model); // Search Properties // Return Search Model return(searchModel); }
public virtual IImageFileSearchModel MapToSearchModel(IImageFileModel model) { var searchModel = NameableEntityMapper.MapToSearchModel <IImageFileModel, ImageFileSearchModel>(model); // Search Properties // Return Search Model return(searchModel); }
public virtual IResourceTypeSearchModel MapToSearchModel(IResourceTypeModel model) { var searchModel = NameableEntityMapper.MapToSearchModel <IResourceTypeModel, ResourceTypeSearchModel>(model); // Search Properties // Return Search Model return(searchModel); }
public virtual IStudioSearchModel MapToSearchModel(IStudioModel model) { var searchModel = NameableEntityMapper.MapToSearchModel <IStudioModel, StudioSearchModel>(model); // Search Properties // Return Search Model return(searchModel); }
public virtual IPowerSearchModel MapToSearchModel(IPowerModel model) { var searchModel = NameableEntityMapper.MapToSearchModel <IPowerModel, PowerSearchModel>(model); // Search Properties // Return Search Model return(searchModel); }
public virtual bool AreEqual(IPowerAliasModel model, IPowerAlias entity) { return(NameableEntityMapper.AreEqual(model, entity) // PowerAlias Properties // <None> // Related Objects && model.PowerId == entity.PowerId ); }
public virtual bool AreEqual(IImageFileModel model, IImageFile entity) { return(NameableEntityMapper.AreEqual(model, entity) // ImageFile Properties // <None> // Related Objects // <None> ); }
public virtual bool AreEqual(IStudioModel model, IStudio entity) { return(NameableEntityMapper.AreEqual(model, entity) // Studio Properties // <None> // Related Objects // <None> ); }
public virtual bool AreEqual(IPowerModel model, IPower entity) { return(NameableEntityMapper.AreEqual(model, entity) // Power Properties // <None> // Related Objects // <None> ); }
public virtual bool AreEqual(IOriginModel model, IOrigin entity) { return(NameableEntityMapper.AreEqual(model, entity) // Origin Properties && model.CharacterSet == entity.CharacterSet // Related Objects // <None> ); }
public virtual bool AreEqual(IConceptAliasModel model, IConceptAlias entity) { return(NameableEntityMapper.AreEqual(model, entity) // ConceptAlias Properties // <None> // Related Objects && model.ConceptId == entity.ConceptId ); }
public virtual bool AreEqual(ILocationAliasModel model, ILocationAlias entity) { return(NameableEntityMapper.AreEqual(model, entity) // LocationAlias Properties // <None> // Related Objects && model.LocationId == entity.LocationId ); }