I wrote my functions to read the value I need. I am testing and waiting answers from you.
namespace Yee.Change.Common.WebShared.IdentityServers
{
using System;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using Volo.Abp.Settings;
using System.Threading.Tasks;
using System.Collections.Generic;
public class SettingUtils
{
public async Task<string> GetSetting(ISettingProvider settingProvider, string externalProviderSchema, string name)
{
string json = await settingProvider.GetOrNullAsync("Abp.Account.ExternalProviders");
if (string.IsNullOrWhiteSpace(json))
{
throw new Exception("json is null");
}
List<ExternalProviderSettings> providers = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ExternalProviderSettings>>(json);
ExternalProviderSettings externalProvider = providers.FirstOrDefault(p => p.Name == externalProviderSchema);
PropertityInfo properti = externalProvider.Propertities.First(p => p.Name == name);
if (properti != null)
{
return properti.Value;
}
return string.Empty;
}
}
public class ExternalProviderSettings
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("enabled")]
public bool Enabled { get; set; }
[JsonProperty("properties")]
public List<PropertityInfo> Propertities { get; set; }
[JsonProperty("secretProperties")]
public List<PropertityInfo> SecretPropertities { get; set; }
}
public class PropertityInfo
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("value")]
public string Value { get; set; }
}
}
Oh, may I use as below?
string providers= await this.SettingProvider.GetOrNullAsync("Abp.Account.ExternalProviders");
I created 2 files as below
Yee.EasyComment.Application.Contracts.Users
public class AppUserDto : IdentityUserDto
{
}
Yee.EasyComment.Domains.Users
public class AppUser : IdentityUser
{
}
https://community.abp.io/posts/abp-suite-how-to-add-the-user-entity-as-a-navigation-property-of-another-entity-furp75ex
I follow above topic. But I got an error. (await GetDbContextAsync()).Users There is no property named Users in EasyCommentDbContext.
protected virtual async Task<IQueryable<CommentWithNavigationProperties>> GetQueryForNavigationPropertiesAsync()
{
return from comment in (await GetDbSetAsync())
join appUser in (await GetDbContextAsync()).Users on comment.AppUserId equals appUser.Id into users
from appUser in users.DefaultIfEmpty()
select new CommentWithNavigationProperties
{
Comment = comment,
AppUser = appUser
};
}
context.Services.AddAuthentication()
.AddGoogle(GoogleDefaults.AuthenticationScheme, _ => { })
.WithDynamicOptions<GoogleOptions, GoogleHandler>(
GoogleDefaults.AuthenticationScheme,
options =>
{
options.WithProperty(x => x.ClientId);
options.WithProperty(x => x.ClientSecret, isSecret: true);
}
)
My question is How to get the danymic option manually? I wan't to use it in Volo.Abp.Account.Pro.Publick.Web.Pages.Accounts.Login.cshtml.cs I must use the values of the danymicoption in below stage.
[UnitOfWork]
public virtual async Task<IActionResult> OnGetExternalLoginCallbackAsync(string returnUrl = "", string returnUrlHash = "", string remoteError = null)
My question can be change to:
If I save feature value for tenant version. Then I can't change the feature value for a single tenant?
Now, I can control the menuitem with IFetureChecker. But another question ... can not change the feature value for a single tenant ater save the value for version.
public class RmsMenuContributor : IMenuContributor
{
public RmsMenuContributor()
{
}
public async Task ConfigureMenuAsync(MenuConfigurationContext context)
{
bool isGranted = await context.AuthorizationService.IsGrantedAsync(Yee.Change.Common.Permissions.AdminPermissions.Admin.Default);
if (!isGranted)
{
return;
}
this._L = context.GetLocalizer<RmsResource>();
if (context.Menu.Name == StandardMenus.Main)
{
await ConfigureMainMenuAsync(context);
}
await SetAiRulesMenu(context);
await SetDic(context);
await SetZipingBazi(context);
await SetLianshanMenus(context);
await SetLiuyaoMenus(context);
await SetKanyuMenus(context);
await SetBasicMenu(context);
await SetTestResultMenu(context);
await SetOperationMenu(context);
await SetProductsMenu(context);
}
[RequiresFeature(Yee.Change.ZipingBazi.Features.ZipingBaziFeature.IsEnabled)]
public virtual async Task SetOperationMenu(MenuConfigurationContext context)
{
var operateMenu = AddOperateMenuItem(context);
AddMenuItemPictures(context, operateMenu);
AddMenuItemUploadPicture(context, operateMenu);