Exemple #1
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static void DeleteById(PK id)
        {
            T            entity   = System.Activator.CreateInstance <T>();
            PropertyInfo property = typeof(T).GetProperty("Id");

            property.SetValue(entity, id, null);
            ActiveRecordBase.Delete(entity);
        }
Exemple #2
0
        /// <summary>
        /// 删除
        /// </summary>
        public void Delete(int id)
        {
            T t = GetEntity(id);

            if (t != null)
            {
                ActiveRecordBase.Delete(t);
            }
        }
Exemple #3
0
        /// <summary>
        /// 删除对象
        /// </summary>
        /// <returns></returns>
        #region Delete
        public static bool DAO_Delete(int id)
        {
            try
            {
                ;
                ActiveRecordBase <T> .Delete(DAO <T> .Find(id));

                return(true);
            }
            catch (Exception ex)
            {
                //LogHelper.WriteLog(LogTag + ".Delete(int id)", ex);
                return(false);
            }
        }
Exemple #4
0
 public new void Delete(T t)
 {
     ActiveRecordBase.Delete(t);
 }
Exemple #5
0
 /// <summary>
 /// 根据实体删除
 /// </summary>
 /// <param name="entity"></param>
 public void Delelte(T entity)
 {
     ActiveRecordBase.Delete(entity);
 }
Exemple #6
0
 public static void DeleteLater(this ActiveRecordBase record)
 {
     RealmServer.IOQueue.AddMessage(() => record.Delete());                              // leave it as a Lambda Expr to get a complete stacktrace
 }
Exemple #7
0
 public static void DeleteLater(this ActiveRecordBase record)
 {
     ServerApp <WCell.RealmServer.RealmServer> .IOQueue.AddMessage((Action)(() => record.Delete()));
 }