public static CosmosdbLite Create(string databaseeName, string containerName)
        {
            lock (mLock)
            {
                if (mInstance != null)
                {
                    return(mInstance);
                }

                return(mInstance = new CosmosdbLite(databaseeName, containerName));
            }
        }
Example #2
0
        static void DoEmployeeService()
        {
            CosmosdbLite     cosmos          = CosmosdbLite.Create(DatabaseeName, ContainerName);
            IEmployeeService employeeService = new EmployeeService(cosmos);

            employeeService.InsertOp("john", "doe").GetAwaiter().GetResult();
            employeeService.InsertOp("tony", "soprano").GetAwaiter().GetResult();
            employeeService.InsertOp("richard", "smith").GetAwaiter().GetResult();

            var query = employeeService.QueryOp(FieldFilter).GetAwaiter().GetResult();

            if (query != null)
            {
                PrintQureyResult(query);
            }

            Console.WriteLine("\n\n");
            Console.WriteLine("Press any key to end");
            Console.ReadKey();
        }