public void WriteToDatabase(SQLiteConnection connection)
 {
     //File must be inserted to Database first (meaning it must have ID).
     if (!DBDwgFile.HasRowPath(connection, relativePath))
     {
         var temp = this;
         ID = DBDwgFile.InsertRow(connection, ref temp);
     }
     else
     {
         DBDwgFile.UpdateRow(connection, this);
     }
 }
        /// <summary>
        /// Check Whether or Not dwg path is in database.
        /// </summary>
        /// <param name="dwgPath">full Path</param>
        /// <returns></returns>
        public static bool IsPathInDatabase(string dwgPath, SQLiteConnection connection)
        {
            string relPath = MakeRelativePath(dwgPath);

            if (string.IsNullOrEmpty(relPath))
            {
                return(false);
            }
            if (DBDwgFile.HasRowPath(connection, relPath))
            {
                return(true);
            }

            return(false);
        }