private void AddProduct() { try { Console.Clear(); string productName = InputProductName(); int productUnitId = InputProductUnit(); decimal productUnitPrice = InputProductPrice(); using (var context = new StorageContext()) { var product = new Product() { Name = productName, UnitId = productUnitId, UnitPrice = productUnitPrice }; _storageController.AddProduct(product); Console.WriteLine($"\nProduct {productName} successfully added to storage."); Console.Write("\nPress any button to continue..."); Console.ReadKey(); } } catch (BackToMenuException) { return; } catch (Exception ex) { Console.WriteLine("\nAn error ocures during adding process."); Console.WriteLine(ex.Message); Console.Write("\nPress any button to continue..."); Console.ReadKey(); } }