/// <summary> /// Remove the specified GenrePopulation from the collection and from storage. /// </summary> /// <param name="population"></param> public static void RemovePopulation(GenrePopulation population) { GenrePopulationCollection.Remove(population); // No need to wait for this DbAccess.DeleteAsync(population); }
/// <summary> /// Create a GenrePopulation and add it to the collection. /// </summary> /// <param name="population"></param> public static GenrePopulation CreatePopulation(int autoplayId, int index, IEnumerable <string> genres) { GenrePopulation newPopulation = new() { AutoplayId = autoplayId, Index = index, GenreString = string.Join(";", genres) }; GenrePopulationCollection.Add(newPopulation); // No need to wait for this DbAccess.InsertAsync(newPopulation); return(newPopulation); }