Exemplo n.º 1
0
        public async Task <bool> ExecuteAsync(IList <SqlCommand> unitOfWorks)
        {
            var result = false;

            using (IOrm orm = this.orm)
            {
                result = await orm.ExecuteAsync(unitOfWorks);
            }
            return(result);
        }
Exemplo n.º 2
0
        public async Task <bool> ExecuteAsync <T>(string sql, IList <Parameter> parameters = null, int timeout = 15) where T : class, new()
        {
            var result = false;

            using (IOrm orm = this.orm)
            {
                result = await orm.ExecuteAsync(new SqlCommand(sql, parameters, timeout));
            }
            return(result);
        }
Exemplo n.º 3
0
        public async Task <bool> InsertAsync <T>(T entity, int timeout = 15) where T : class, new()
        {
            var result = false;

            if (entity != null)
            {
                SqlCommand queryResult = DynamicQuery.GetInsertQuery(typeof(T).Name.ToLowerInvariant().Pluralize(), entity);
                using (IOrm orm = this.orm)
                {
                    result = await orm.ExecuteAsync(new SqlCommand(queryResult.Statement, queryResult.Parameters, timeout));
                }
            }
            return(result);
        }