this sounds like you need to mock the IWebHostEnvironment
in your test module.
I'll show you how to do that;
https://support.abp.io/QA/Questions/1077/Testing-Overridden-AppService#answer-1bbd38f2-5f8c-36ad-6eeb-39fb70a23930
@mehmet what do you think?
check your database table: IdentityServerClientRedirectUris
if you are using the default URLs, those are configured for local development.
Replace all your localhost
URLs to your production addresses.
These 2 requirements force your architecture as multi-tenant:
Otherwise I would say you don't need multitenancy. On the other hand, you need 2 different setups: a public front facing website and backoffice (management) website.
The products can be non-multitenant (otherwise clients cannot reach them). And you can filter the products manually as per your tenants (entities). (for managing products)
Clients can be normal IdentityUser (AbpUser). They can access products without any issues.
In exceptional cases you might need to access to your tenant's data, in this case you can switch to a tenant. this is possible with this code
For the backend you can use MVC or Blazor (doesn't matter) For the front-facing side you should use MVC (for SEO friendliness).
I suggest you to make a prototype, an MVP before starting your real project. This will be good to foresee some potential future issues.
And let me know how you implement this
you can set an empty string to table prefix. but you need to clear the DG Migrations and regenerate them.
I'm adding @Engin the author of this article. maybe he knows it
we use Blazorise DataGrid in the Blazor template.
And you can also use Nested fields
in datagrid.
https://blazorise.com/docs/extensions/datagrid/#nested-fields
as a summary, this doesn't seem to be a framework issue and we are talking about EF Core functionality.
this is not related to Docker.
Can you run the project in Release mode, it must throw the same exception.
it seems like you have an embedded resource in /Yiki.CoFarm.Domain.Shared/
and its path is not correct
Be aware that Unit Test module will not initialize when you are using a real IWebHostEnvironment
.
And you have a IWebHostEnvironment
argument in the constructor of the ApplicationService.
You need to mock WebHostEnvironment
in order to get it run.
Because there's no real WebHostEnvironment in the test phase:
Mock class for IWebHostEnvironment
:
WebHostEnvironmentMock.cs
public class WebHostEnvironmentMock : IWebHostEnvironment
{
public string EnvironmentName { get; set; }
public string ApplicationName { get; set; }
public string ContentRootPath { get; set; }
public IFileProvider ContentRootFileProvider { get; set; }
public IFileProvider WebRootFileProvider { get; set; }
public string WebRootPath { get; set; }
public WebHostEnvironmentMock()
{
var absoluteRootPath = Path.GetFullPath(string.Format("..{0}..{0}..{0}..{0}..{0}src{0}Siemens.NMM.Web, System.IO.Path.DirectorySeparatorChar));
ContentRootPath = absoluteRootPath; //absolute path to your Web project
WebRootPath = Path.Combine(absoluteRootPath, "wwwroot"); //this should point to wwwroot of your Web project
}
}
Replace the implementation of IWebHostEnvironment
to your mock class:
NMMApplicationTestModule.cs
public class NMMWebTestModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
context.Services.AddSingleton<IWebHostEnvironment>(new WebHostEnvironmentMock());
}
}
This doesn't seem to be related to the ABP Framework.
See these: