Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LocalFileContext"/> class.
 /// </summary>
 /// <param name="provider">The provider.</param>
 /// <param name="p">The p.</param>
 private LocalFileContext(IDalObjectProvider provider, SqlLiteFactoryProvider p)
     : base(provider, new ManagersFactory(p))
 {
     _currentUser = new User {
         Login = "******"
     };
 }
Beispiel #2
0
        /// <summary>
        /// Creates the database.
        /// </summary>
        /// <param name="filePath">The file path.</param>
        /// <returns></returns>
        public static LocalFileContext CreateDatabase(string filePath)
        {
            var p = new SqlLiteFactoryProvider(filePath);

            p.CreateNewDatabase();
            var provider = new DalMultiThreadProvider(p);
            var context  = new LocalFileContext(provider, p);

            p.Context = context;
            return(context);
        }