示例#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);
        }
示例#2
0
        /// <summary>
        /// 删除
        /// </summary>
        public void Delete(int id)
        {
            T t = GetEntity(id);

            if (t != null)
            {
                ActiveRecordBase.Delete(t);
            }
        }
示例#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);
            }
        }
示例#4
0
 public new void Delete(T t)
 {
     ActiveRecordBase.Delete(t);
 }
示例#5
0
 /// <summary>
 /// 根据实体删除
 /// </summary>
 /// <param name="entity"></param>
 public void Delelte(T entity)
 {
     ActiveRecordBase.Delete(entity);
 }
示例#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
 }
示例#7
0
 public static void DeleteLater(this ActiveRecordBase record)
 {
     ServerApp <WCell.RealmServer.RealmServer> .IOQueue.AddMessage((Action)(() => record.Delete()));
 }