Ejemplo n.º 1
0
        private void HandleInput()
        {
            switch (input)
            {
            case 0:     // Insert
                Console.Write("Number of records (default 1): ");
                var count = int.Parse(Console.ReadLine() ?? "1");
                DoInsert(count);
                break;

            case 1:     // Find
                Console.Write("Property Id: ");
                var findId = int.Parse(Console.ReadLine() ?? "1");

                Console.WriteLine(DoFind(findId)
                        ? "Record was found."
                        : "Record with given id doesn't exist.");
                break;

            case 2:     // Delete
                Console.Write("Property Id: ");
                var deleteId = int.Parse(Console.ReadLine() ?? "-1");

                Console.WriteLine(DoDelete(deleteId)
                        ? "Record was deleted."
                        : "Record with given id doesn't exist.");
                break;

            case 3:     // Random
                Console.Write("Number of operations: ");
                var operationsCount = int.Parse(Console.ReadLine() !);
                DoRandomOperations(operationsCount);
                break;

            case 4:     // Save
                hashing.Save();
                break;

            case 5:     // Clear
                Clear();
                break;

            case 6:     // Exit
                exit = true;
                break;

            default:
                exit = true;
                break;
            }
        }
Ejemplo n.º 2
0
        public bool CanSeed => true;//_count == 0;

        internal void Save()
        {
            _context.Save();
        }