public void Register(string name, string displayName) { if (!_apiScopeRepository.GetAll().Any(e => e.Name == name)) { ApiScope apiScope = new ApiScope(name); apiScope.SetDisplayName(displayName ?? name); _apiScopeRepository.Insert(apiScope); } }
public void Register(string name, string displayName, List <Permission> managePermissions, List <Permission> queryPermissions) { if (!ApiScopeRepository.GetAll().Any(e => e.Name == name)) { ApiScope apiScope = new ApiScope(name); apiScope.SetDisplayName(displayName ?? name); managePermissions.ForEach(item => apiScope.ApiManageScope.AddPermission(item)); queryPermissions.ForEach(item => apiScope.ApiQueryScope.AddPermission(item)); ApiScopeRepository.Insert(apiScope); } }