コード例 #1
0
        public Task <int> ExecuteCommandAsync()
        {
            Task <int> result = new Task <int>(() =>
            {
                IInsertable <T> asyncInsertable = CopyInsertable();
                return(asyncInsertable.ExecuteCommand());
            });

            result.Start();
            return(result);
        }
コード例 #2
0
        public int Insert <T>(T entity, Expression <Func <T, object> > pk = null, bool isIdentity = true) where T : class, new()
        {
            IInsertable <T> insertObj = _db.Insertable(entity);

            if (pk != null)
            {
                insertObj = insertObj.IgnoreColumns(pk);
            }
            if (isIdentity)
            {
                return(insertObj.ExecuteReturnIdentity());
            }
            return(insertObj.ExecuteCommand());
        }
コード例 #3
0
ファイル: SugarWInsertable.cs プロジェクト: litesz/WFw
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public int ExecuteCommand()
 {
     return(_insertable.ExecuteCommand());
 }