public async Task <bool> ExecuteAsync(IList <SqlCommand> unitOfWorks) { var result = false; using (IOrm orm = this.orm) { result = await orm.ExecuteAsync(unitOfWorks); } return(result); }
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); }
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); }