Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否考虑在MAction类增加IsIgnoreDeleteField属性 #41

Open
ghostalien opened this issue May 11, 2020 · 1 comment
Open

能否考虑在MAction类增加IsIgnoreDeleteField属性 #41

ghostalien opened this issue May 11, 2020 · 1 comment

Comments

@ghostalien
Copy link

能否考虑在MAction类增加IsIgnoreDeleteField属性,默认为false;
目的:
1.调整框架的select方法,自动忽略掉表中IsDeleted为true的记录,符合正常的业务需求;当IsIgnoreDeleteField属性为true时,才返回所有记录。
2.调整框架delete方法,当IsIgnoreDeleteField属性为true时,带IsDeleted的表也执行物理删除。

@ghostalien
Copy link
Author

                    #region 增加软删除过滤 by alien
                        string deleteField = AppConfig.DB.DeleteField;
                        bool isSoftDelete = !IsIgnoreDeleteField && !string.IsNullOrEmpty(deleteField) && _Data.Columns.Contains(deleteField);
                        if (isSoftDelete) whereSql = _sqlCreate.FormatWhereForDeleteField(whereSql);
                    #endregion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant