Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "aaron"

What's in the error log?

That's what I suspected. Try doing:

MyEntityDetails.MyChildEntity = MyChildEntity.ToList();
  1. Are you using multiple threads (like in the issue linked by @ismcagdas), or not awaiting async Tasks properly?
  2. How are MyEntityAppService.GetMyEntityDetailsforEdit and CommonAppService.GetLookupItems related?

What's the implementation of CommonAppService.GetLookupItems?

Don't do it in the constructor. You can make it a method.

Make all your projects target netcoreapp2.0 to avoid errors of this form:

"Package '...' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project."

If you can put both appsettings.json and testappsettings.json in the same folder, just follow these 3 steps:

  • Add the line below in AppConfigurations:
private static IConfigurationRoot BuildConfiguration(string path, string environmentName = null, bool addUserSecrets = false)
{
    var builder = new ConfigurationBuilder()
        .SetBasePath(path)
        .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
        .AddJsonFile("testappsettings.json", optional: true, reloadOnChange: true); // This line

    // ...
}
  • Change this method in Helpers.cs:
public static IConfigurationRoot GetConfiguration()
{
    return SingletonDependency<IAppConfigurationAccessor>.Instance.Configuration; // This line
}

Your original way works. Your original way:

#4375

Your original way:

.AddJsonFile(Path.Combine(currentPath, "..", "..", "..", "..", "..", "src", "MyCompany.MyProject.Web.Host", $"appsettings.json"), false);

Get configuration:

IocManager.Register<IAppConfigurationAccessor, TestAppConfigurationAccessor>();
var configuration = IocManager.Resolve<IAppConfigurationAccessor>().Configuration;
Configuration.Modules.AspNetZero().LicenseCode = configuration["AbpZeroLicenseCode"];

The commented section works fine when uncommented but I wonder if there is any way of having the UpdateOwnAsync method instead of the UpdateAsync method on the _jobLocationRepository?

await _jobLocationRepository.UpdateOwnAsync(jobLocation);

The problem is that the IsGrantedAsync() fails and throws exception when no logged in user. So first I need to check if the request is coming from a logged in user or not

It's GetCurrentUser() that throws. GetCurrentUser calls AbpSession.GetUserId(). Read the documentation on Session Properties:

If you're sure there is a current user, you can call GetUserId(). If the current user is null, this method throws an exception.

So just check if AbpSession.UserId is null.

Showing 1121 to 1130 of 1543 entries