public static void Main(string[] args) { // Create UserInputName UserInputName = newUserInput.Name; UserBookName UserBookName = newBook.Name; GenreName GenreName = newGenre.Name; TimeItTook TimeItTook = newTimeItTook; TodaysDate TodaysDate = newTodaysDate; Console.WriteLine("What is your Name?"); Console.ReadLine(); Console.WriteLine("What is your favorite book?"); Console.ReadLine(); Console.WriteLine("What genre is this book?); Console.ReadLine(); Console.WriteLine("How long did it take you to read this book?") Console.ReadLine(); Console.WriteLine("What is today's Date?"); Console.ReadLine(); // Update }
public Book(int id, string title, Author author, GenreName genre = GenreName.Fiction, string description = null) { Id = id; Title = title; Author = author; Genre = genre; Description = description; }
public Song(int id, string artist, string title, GenreName genre, int yearOfRelease, int likes, string des) { Id = id; Artist = artist; Title = title; Genre = genre; YearOfRelease = yearOfRelease; Likes = likes; Description = des; }
private bool UpdateGenre(Game game) { bool IsUpdated = false; List <Genre> GameGenres = game.Genres; if (GameGenres != null && GameGenres.Count > 0) { // Rename List <Genre> AllGenresOld = GameGenres.FindAll(x => PluginSettings.ListGenreEquivalences.Any(y => y.OldNames.Any(z => z.ToLower() == x.Name.ToLower()))); if (AllGenresOld.Count > 0) { // Remove all foreach (Genre genre in AllGenresOld) { game.GenreIds.Remove(genre.Id); IsUpdated = true; } // Set all foreach (LmGenreEquivalences item in PluginSettings.ListGenreEquivalences.FindAll(x => x.OldNames.Any(y => AllGenresOld.Any(z => z.Name.ToLower() == y.ToLower())))) { if (item.Id != null) { game.GenreIds.AddMissing((Guid)item.Id); IsUpdated = true; } } } // Exclusion if (PluginSettings.ListGenreExclusion.Count > 0) { foreach (string GenreName in PluginSettings.ListGenreExclusion) { Genre genreDelete = game.Genres.Find(x => x.Name.ToLower() == GenreName.ToLower()); if (genreDelete != null) { game.GenreIds.Remove(genreDelete.Id); IsUpdated = true; } } } } if (IsUpdated) { Application.Current.Dispatcher?.BeginInvoke((Action) delegate { PlayniteApi.Database.Games.Update(game); }).Wait(); } return(IsUpdated); }
/// <summary> /// genre constructor /// </summary> /// <param name="genreId"></param> /// <param name="genreName"></param> public Genre(int genreId, GenreName genreName) { this.GenreId = genreId; this.Genrename = genreName; }