Ejemplo n.º 1
0
        public Task <int> ExecuteCommandAsync()
        {
            Task <int> result = new Task <int>(() =>
            {
                IInsertable <T> asyncInsertable = CopyInsertable();
                return(asyncInsertable.ExecuteCommand());
            });

            result.Start();
            return(result);
        }
Ejemplo n.º 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());
        }
Ejemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public int ExecuteCommand()
 {
     return(_insertable.ExecuteCommand());
 }