The questions has changed, now there are 2 as below
I want to get all users in the database, so I disable the DataFilter. But it seems that the IMultiTenant has not been disabled. I only get the users in the current tenant.
using (this.DataFilter.Disable<IMultiTenant>())
{
users = await userRepository.GetListAsync();
}
Thank you!
public class SerialNumberMoreAppService : AccountAppService, ISerialNumberMoreAppService
{
public virtual async Task<long> GetNextValueAsync()
{
SerialNumberManager repository = this.LazyServiceProvider.LazyGetRequiredService<SerialNumberManager>();
var netSerial = await repository.CreateAsync("");
await UnitOfWorkManager.Current.SaveChangesAsync();
return netSerial.Id;
}
}
but user.SetProperty only valid for the first user?
I want to reset propertiy for all users.
foreach (var user in users)
{
var number = await serialNumberMoreAppService.GetNextValueAsync();
user.SetProperty(ChangeUserConsts.NumberIdPropertityName, number);
await UnitOfWorkManager.Current.SaveChangesAsync();
}
Oh, It is caused by Automapper. My custome module missed settings. After I resolve my own Automapper configuration. program starte successfully.
abp install-libs
Thanks! After I run the command abp install-libs on solution folder, the error has been fixed.
I have upgrade ABP suite to 5.2.0.
**********************************************************************
** Visual Studio 2022 Developer PowerShell v17.1.3
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
PS D:\abp-change\NuGetReferenceUpdator> abp suite
[05:56:46 INF] ABP CLI (https://abp.io)
[05:56:47 INF] Version 5.2.0 (Stable)
Starting Suite v5.2.0 ...
Opening http://localhost:3000
Press Ctrl+C to shut down.
And I have click 'Update all ABP packages'. It excutes successfully. but the dialog is version 5.1.4
Waiting for reply……
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; }
}
}