private static void InsertToDatabase(IMongoCollection <EnergyDrink> collection) { Console.Clear(); Console.Write("Enter the name of the drink:"); var name = Console.ReadLine(); Console.Write("\nEnter the price of the drink:"); var price = double.Parse(Console.ReadLine()); var energyDrink = new EnergyDrink(name, price); collection.InsertOneAsync(energyDrink); Console.WriteLine("The drink was successfuly added"); Console.WriteLine("\nPress any key to continue.."); Console.ReadLine(); }
private static void InsertToDatabase(IMongoCollection<EnergyDrink> collection) { Console.Clear(); Console.Write("Enter the name of the drink:"); var name = Console.ReadLine(); Console.Write("\nEnter the price of the drink:"); var price = double.Parse(Console.ReadLine()); var energyDrink = new EnergyDrink(name, price); collection.InsertOneAsync(energyDrink); Console.WriteLine("The drink was successfuly added"); Console.WriteLine("\nPress any key to continue.."); Console.ReadLine(); }