Exemplo n.º 1
0
 public void AddActorId(int actorId)
 {
     if (ActorsIds.Contains(actorId))
     {
         throw new Exception("This actor ID is already in the list");
     }
     if (actorId < 0)
     {
         throw new Exception("Actor's ID cannot be negative");
     }
     else
     {
         GenreIds.Add(actorId);
     }
 }
Exemplo n.º 2
0
 public void AddGenreId(int genreId)
 {
     if (GenreIds.Contains(genreId))
     {
         throw new Exception("This genre ID is already in the list");
     }
     if (genreId < 0)
     {
         throw new Exception("Genre ID cannot be negative");
     }
     else
     {
         GenreIds.Add(genreId);
     }
 }
Exemplo n.º 3
0
        public MangaDTO(Manga manga)
        {
            Id               = manga.Id;
            Name             = manga.Name;
            ReleaseDate      = manga.ReleaseDate;
            Volume           = manga.Volume;
            ReleaseContinues = manga.ReleaseContinues;
            Translater       = manga.Translater;
            Author           = manga.Author;
            PhotoBase64      = manga.PhotoBase64;

            foreach (Genre genre in manga.Genre)
            {
                GenreIds.Add(genre.Id);
            }
        }
Exemplo n.º 4
0
        public AnimeDTO(Anime anime)
        {
            Id            = anime.Id;
            Name          = anime.Name;
            ReleaseDate   = anime.ReleaseDate;
            Studio        = anime.Studio;
            Type          = anime.Type;
            CountEpisodes = anime.CountEpisodes;
            Status        = anime.Status;
            Source        = anime.Source;
            Season        = anime.Season;
            PhotoBase64   = anime.PhotoBase64;

            foreach (Genre genre in anime.Genres)
            {
                GenreIds.Add(genre.Id);
            }

            foreach (Studio voice in anime.Voices)
            {
                VoiceIds.Add(voice.Id);
            }
        }