Пример #1
0
        /// <summary>
        /// Delete all record then insert.
        ///
        /// </summary>
        /// <param name='objects'>
        /// Objects.
        /// </param>
        /// <typeparam name='T'>
        /// The 1st type parameter.
        /// </typeparam>
        public void ReplaceAll <T>(T[] objects)
        {
            var    desc   = Registory.GetClassDesc <T>();
            string delete = SQLMaker.GenerateDeleteAllSQL <T>(desc);

            database.ExecuteNonQuery(delete);

            foreach (T obj in objects)
            {
                string insert = SQLMaker.GenerateInsertSQL(desc, obj);
                database.ExecuteNonQuery(insert);
            }
        }
Пример #2
0
        public void DeleteAll <T>()
        {
            var desc = Registory.GetClassDesc <T>();

            database.ExecuteNonQuery(SQLMaker.GenerateDeleteAllSQL <T>(desc));
        }