Example #1
0
        public async Task <bool> Update(TEntity entity, List <string> lstColumns = null, List <string> lstIgnoreColumns = null, string strWhere = "")
        {
            //throw new NotImplementedException();
            IUpdateable <TEntity> up = await Task.Run(() => db.Updateable(entity));

            if (lstIgnoreColumns != null && lstIgnoreColumns.Count > 0)
            {
                up = await Task.Run(() => up.IgnoreColumns(it => lstIgnoreColumns.Contains(it)));
            }
            if (lstColumns != null && lstColumns.Count > 0)
            {
                up = await Task.Run(() => up.UpdateColumns(it => lstColumns.Contains(it)));
            }
            if (!string.IsNullOrEmpty(strWhere))
            {
                up = await Task.Run(() => up.WhereColumns(strWhere));
            }
            return(await Task.Run(() => up.ExecuteCommand()) > 0);
        }