MenuContributor will be triggered with MenuConfigurationContext
and it contains ServiceProvider
as a property. You can resolve any service by using it:
public async Task ConfigureMenuAsync(MenuConfigurationContext context)
{
var userTaskPublicAppService = context.ServiceProvider.GetRequiredService<IUserTaskPublicAppService>();
}
Hi @shijo ABP Framework doesn't provide a configuration for tenant-based blob provider resolution. There are a couple of ways to achieve tenant-based storage.
IServiceProvider
.
var provider = serviceProvider.GetRequiredService<AzureBlobProvider>();
// Or with type
var provider = (BlobProviderBase) serviceProvider.GetRequiredService(typeof(AzureBlobProvider));
// According to a rule:
var provider = (BlobProviderBase) serviceProvider.GetRequiredService(providerMappingDictionary[CurrentTenant.Id]); //Dictionary returns type
await provider.SaveAsync(...);
Hi @zhongfang
As I see you decorated your method with RequiresFeature
attribute you called it directly in code. There is no interceptor is executed because you made a regular method call.
That attribute works on AppServices or Controllers well, it won't work your manual method calls.
Try injecting IFeatureChecker
and check the feature with it.
public class RmsMenuContributor : IMenuContributor
{
private readonly IFeatureChecker _featureChecker;
public RmsMenuContributor(IFeatureChecker featureChecker)
{
_featureChecker = featureChecker;
}
public async Task ConfigureMenuAsync(MenuConfigurationContext context)
{
// ...
if (await _featureChecker.IsEnabledAsync(Yee.Change.ZipingBazi.Features.ZipingBaziFeature.IsEnabled))
{
await SetOperationMenu(context);
}
await SetProductsMenu(context);
}
[RequiresFeature(Yee.Change.ZipingBazi.Features.ZipingBaziFeature.IsEnabled)]
public virtual async Task SetOperationMenu(MenuConfigurationContext context)
{
var operateMenu = AddOperateMenuItem(context);
AddMenuItemPictures(context, operateMenu);
AddMenuItemUploadPicture(context, operateMenu);
You have to call it with assembly name in blazor.
_content/Volo.Abp.AspNetCore.Components.Web.LeptonTheme/assets/imgs/call-an-expert-person.svg
You should initialize your ABP module in the non-abp project to run existing features that the theme depends on like menus, authentication etc.
https://github.com/abpframework/abp/blob/dev/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Program.cs#L37-L39
Then MainLayout can draw itself. Otherwise, you'll get some dependency injection exception that says there is no registered services for some operations like drawing menu, initializing toolbars or creating user menu operations. etc
Hello @johannes.schreiner
All of ABP Framework packages support Source Link that allows to you debug the source code.
You can use following article for configuring debugging with source link: https://devblogs.microsoft.com/dotnet/improving-debug-time-productivity-with-source-link/
Issue with this proposed solution is that it would create a circular reference as the ABP Blazer Module references the non-ABP app (to bring in it services).
I don't think there should be a circular reference, Each layer of ABP is already separated for those kind of requirements. You have to share your project structure to find a solution.
In other words when ABP routes to the non-ABP Blazor app, I need the CSS to be "clean", so is there a way of completely removing the prevailing ABP CSS/Layout at that point?
It's a simple javascript logic. you can remove some css files like this: https://stackoverflow.com/questions/24087152/remove-css-file-with-javascript And re-add like this: https://stackoverflow.com/a/577002/7200126
It's not ABP or Blazor related topic. You can solve that problem with javascript.
We don't have such as template and we don't officially support WPF or some other clients like xamarin or maui right now.
Try to implement yourself, if you face a problem that occurs because of ABP Framework, then we are pleased to help. Otherwise, we can't show a best path to you how to develop that kind of clients.
Following articles might help
Hi @Teknosol
Thank you for your request,
Currently, we don't have a plan such as this one.
We've received your request and we'll discuss it.
We are planning a new release (5.1.4) on 28.02.2022.
...
5.1.4 has been released