fix(#I177E5): 修复 MongoDB 无法保存新建项
#Comment MongoDB 主键设置为 null #Issue close https://gitee.com/LongbowEnterprise/dashboard/issues?id=I177E5
This commit is contained in:
parent
2a84ecf4f4
commit
22ed63278a
|
@ -41,6 +41,7 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
{
|
||||
if (string.IsNullOrEmpty(p.Id))
|
||||
{
|
||||
p.Id = null;
|
||||
DbManager.Dicts.InsertOne(p);
|
||||
p.Id = DbManager.Dicts.Find(d => d.Name == p.Name && d.Category == p.Category && d.Define == p.Define && d.Code == p.Code).FirstOrDefault().Id;
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
{
|
||||
if (string.IsNullOrEmpty(p.Id))
|
||||
{
|
||||
p.Id = null;
|
||||
DbManager.Groups.InsertOne(new Group()
|
||||
{
|
||||
GroupCode = p.GroupCode,
|
||||
|
|
|
@ -56,6 +56,7 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
{
|
||||
if (string.IsNullOrEmpty(p.Id))
|
||||
{
|
||||
p.Id = null;
|
||||
DbManager.Menus.InsertOne(p);
|
||||
p.Id = DbManager.Menus.Find(m => m.Name == p.Name && m.Category == p.Category && m.ParentId == p.ParentId && m.Url == p.Url).FirstOrDefault().Id;
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
{
|
||||
if (string.IsNullOrEmpty(p.Id))
|
||||
{
|
||||
p.Id = null;
|
||||
DbManager.Roles.InsertOne(new Role()
|
||||
{
|
||||
RoleName = p.RoleName,
|
||||
|
|
Loading…
Reference in New Issue