Ejemplo n.º 1
0
        /// <summary>
        /// Create the singleton instance.
        /// </summary>
        private static SingletonDb CreateSingleton()
        {
            InMemoryDataBase db = CreateDb();

            return(new SingletonDb(db));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create the singleton instance.
        /// </summary>
        private static async Task <SingletonDb> CreateSingletonAsync()
        {
            InMemoryDataBase db = await CreateDbAsync();

            return(new SingletonDb(db));
        }
Ejemplo n.º 3
0
        //private static readonly Task<SingletonDb> CreateSingletonTask =
        //        CreateSingletonAsync();

        //public static Task<SingletonDb> SingletonAsync
        //{
        //    get { return CreateSingletonTask; }
        //}

        /// <summary>
        /// The private instance-constructor, taking some data.
        /// </summary>
        private SingletonDb(InMemoryDataBase db)
        {
            InMemoryDb = db;
        }