public ExtensionConfiguration ToConfiguration() { ExtensionConfiguration config = new ExtensionConfiguration(); foreach (var id in allRoles) { config.AllRoles.Add(new ExtensionConfiguration.Extension { Id = id }); } foreach (var r in namedRoles) { if (r.Value.Any()) { var nr = new ExtensionConfiguration.NamedRole { RoleName = r.Key }; foreach (var v in r.Value) { nr.Extensions.Add(new ExtensionConfiguration.Extension { Id = v }); } config.NamedRoles.Add(nr); } } return(config); }
public ExtensionConfiguration ToConfiguration() { ExtensionConfiguration config = new ExtensionConfiguration(); foreach (var id in allRoles) { config.AllRoles.Add(new ExtensionConfiguration.Extension { Id = id }); } foreach (var r in namedRoles) { if (r.Value.Any()) { var nr = new ExtensionConfiguration.NamedRole { RoleName = r.Key }; foreach (var v in r.Value) { nr.Extensions.Add(new ExtensionConfiguration.Extension { Id = v }); } config.NamedRoles.Add(nr); } } return config; }