Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the Database.
        /// if the database doesn't exist, it will create the database and all the tables.
        /// </summary>
        /// <param name='path'>
        /// Path.
        /// </param>
        public Database(string path) : base(path, true, "Password")
        {
            try
            {
                LogsHandler.WriteDebug("CreateTable MainTable");

                // create the tables
                CreateTable <DataAccessLayer.Models.Tables.MainTable>();
            }
            catch (Exception Ex)
            {
                LogsHandler.WriteException(Ex);
            }
        }
Ejemplo n.º 2
0
        protected Repository()
        {
            try
            {
                LogsHandler.WriteDebug("DataModel.DAL.Repository: Initiate Repository");

                // set the db location
                dbLocation = DatabaseFilePath;

                // instantiate the database
                db = new DL.Database(dbLocation);
            }
            catch (Exception Ex)
            {
                LogsHandler.WriteException(Ex);
            }
        }