You can overiide some base class methods of AbpInputTagHelperService in your MyInputTagHelperService .
https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs
Maybe you can try:
using System.Text.Encodings.Web;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form;
using Volo.Abp.DependencyInjection;
namespace MyCompanyName.MyProjectName.Web
{
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(AbpInputTagHelperService))]
public class MyInputTagHelperService : AbpInputTagHelperService
{
public MyInputTagHelperService(IHtmlGenerator generator,
HtmlEncoder encoder,
IAbpTagHelperLocalizer tagHelperLocalizer)
: base(generator, encoder, tagHelperLocalizer)
{
}
}
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(AbpInputTagHelper))]
public class MyInputTagHelper : AbpInputTagHelper
{
public MyInputTagHelper(AbpInputTagHelperService tagHelperService)
: base(tagHelperService)
{
}
}
}
hi
You can try to create a new taghelper and make it executed first.
https://github.com/abpframework/abp/blob/48c52625f4c4df007f04d5ac6368b07411aa7521/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpIdNameTagHelper.cs#L18
hi
You can create a new project then check the code of XXXDbMigrationService
hi
It seems the Swashbuckle.AspNetCore
do some change for IIS virtual directory, Can you try to upgrade and re-try?
https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1953 https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1392#issuecomment-697348303
hi
abphelper cli has a feature that we can run CRU based on a c# model class
Can you share the details of this feature?
hi
Can you share the source code of your XXXDbMigrationService
?
It should contain such code like below.
foreach (var tenant in tenants)
{
using (_currentTenant.Change(tenant.Id))
{
await SeedDataAsync(tenant);
}
}
hi
Please check PostGreController in FD.Demo.MicroService.Host project. We are trying to access appuserRepository for specific tenant but without any luck.
You can use CurrentTenant.Change
to switch host and tenant.
[ApiController]
public class PostGreController : AbpController
{
private readonly IAppUsers _appuserRepository;
private readonly IDbContextProvider<DemoDbContext> _dbContextProvider;
public PostGreController(IAppUsers appuserRepository, IDbContextProvider<DemoDbContext> dbContextProvider)
{
_appuserRepository = appuserRepository;
_dbContextProvider = dbContextProvider;
}
[Route("/api/v1/test")]
[HttpGet]
[ProducesResponseType((int)HttpStatusCode.Accepted)]
public async Task<IActionResult> test()
{
using (CurrentTenant.Change(null))
{
var abcInHostDatabase = await _appuserRepository.GetListAsync();
}
var ten1 = new Guid("your tenant id to switch tenant");
using (CurrentTenant.Change(ten1))
{
var abcInTenantDatabase = await _appuserRepository.GetListAsync();
}
var demoDbContext = await _dbContextProvider.GetDbContextAsync();
return Ok();
}
}
Our general issue is, how to access DemoDBContext from FD.Demo.Microservice.Host project.
Reference FD.Demo.EntityFrameworkCore.csproj
in your FD.Demo.Microservice.Host
project.
var demoDbContext = await _dbContextProvider.GetDbContextAsync();
hi Let's discuss at https://support.abp.io/QA/Questions/1220#answer-f5948184-088a-d6ea-fb84-39fc291d3f8c