Skip to content

通过界面无法添加不同组相同键的配置项 #228

@bingBird

Description

@bingBird

经排查是添加逻辑中没有添加配置时候组过滤没起效引起的,具体代码段为:src/AgileConfig.Server.Service/ConfigService.cs下的150-160行代码引起

 if (string.IsNullOrEmpty(group))
        {
            Expression<Func<Config, bool>> exp1 = c => c.Group == "" || c.Group == null;
            exp.And(exp1);
        }
        else
        {
            Expression<Func<Config, bool>> exp1 = c => c.Group == group;
            exp.And(exp1);
        }

需要修改为:

 if (string.IsNullOrEmpty(group))
 {
     Expression<Func<Config, bool>> exp1 = c => c.Group == "" || c.Group == null;
     exp = exp.And(exp1);
 }
 else
 {
     Expression<Func<Config, bool>> exp1 = c => c.Group == group;
     exp = exp.And(exp1);
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions