Activities of "zhongfang"

The questions has changed, now there are 2 as below

1. ExtraPropertity only Saved for the first one

2. Only return users of current tenant.

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!

replace Repository with Manager

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;
        }
    }

Can get increased id successfully, but ...

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

  • In visual studio
  • Right click on the solution
  • select 'Open in Terminal'
  • abp install-libs
  • return

Thanks! After I run the command abp install-libs on solution folder, the error has been fixed.

Oh, after I renamed the file, add -s. I can run the application now.

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

Many files has been added.

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; }
    }
}

Showing 61 to 70 of 116 entries
Made with ❤️ on ABP v9.0.0-preview Updated on September 20, 2024, 08:30