duplicate of #263. closing this one.
can you try to download this sample and check with the same configuration. I think it's not related with your angular code.
I'm closing this question.
You can also use PdfSharpCore library if you want to generate PDF in cross-platform. https://www.nuget.org/packages/PdfSharpCore/
First of all, the settings with the same key is being cached, so the second call will not go to database.
Also, you can inject ISettingProvider and use GetAllAsync() to retrieve all. it's better than getting 30 of them.
If you want to multiple features you can also injectIFeatureValueRepository see
https://github.com/abpframework/abp/blob/dev/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureManagementStore.cs
in ABP v3.0 settings and permission usage will be refactored and will be made more performance
can you check this https://aspnetboilerplate.com/Pages/Documents/Zero/Organization-Units#common-use-cases it's very similar
you can hide the endpoints easily, see https://support.abp.io/QA/Questions/264/How-to-hide-an-endpoint-from-Swagger
To hide endpoints in Swagger, you can use IDocumentFilter of the Swashbuckle.
class HideOrganizationUnitsFilter : IDocumentFilter
{
private const string pathToHide = "/identity/organization-units";
public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
{
var organizationUnitPaths = swaggerDoc
.Paths
.Where(pathItem => pathItem.Key.Contains(pathToHide, StringComparison.OrdinalIgnoreCase))
.ToList();
foreach (var item in organizationUnitPaths)
{
swaggerDoc.Paths.Remove(item.Key);
}
}
}
in ConfigureSwaggerServices, add this document filter
private void ConfigureSwaggerServices(IServiceCollection services)
{
services.AddSwaggerGen(
options =>
{
options.SwaggerDoc("v1", new OpenApiInfo {Title = "MyProjectName API", Version = "v1"});
options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName);
options.DocumentFilter<HideOrganizationUnitsFilter>(); //<-------- added this -----------
}
);
}
Forgotten User: The logic and emails for Forgotten User is together in this.accountService.sendPasswordResetCode. If I am using my own emailer I need to replace this with my own endpoint. What do I need to send. In .Net Core Identity I would do something like this but I don't know what to do is this case because I can't see the code.
to replace the existing email sender service; https://support.abp.io/QA/Questions/260/How-to-replace-the-existing-email-sender-with-my-own#answer-cc999500-981c-25df-e932-39f5f3e7f71b
You can create a new class inherits from IEmailSender
public class MyCustomEmailSender : IEmailSender
{
public Task SendAsync(string to, string subject, string body, bool isBodyHtml = true)
{
throw new System.NotImplementedException();
}
public Task SendAsync(string @from, string to, string subject, string body, bool isBodyHtml = true)
{
throw new System.NotImplementedException();
}
public Task SendAsync(MailMessage mail, bool normalize = true)
{
throw new System.NotImplementedException();
}
public Task QueueAsync(string to, string subject, string body, bool isBodyHtml = true)
{
throw new System.NotImplementedException();
}
}
alternatively, you can inherit from EmailSenderBase, so you can just override the SendEmailAsync()
public class MyCustomEmailSender : EmailSenderBase
{
public MyCustomEmailSender(IEmailSenderConfiguration configuration, IBackgroundJobManager backgroundJobManager) : base(configuration, backgroundJobManager)
{
}
protected override Task SendEmailAsync(MailMessage mail)
{
//send your email
}
}
And replace the existing implemantation with yours in your Application project's ApplicationModule. Remove the below code section
#if DEBUG
context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, NullEmailSender>());
#endif
and add
context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, MyCustomEmailSender>());
login / logout actions are not stored in audit logs by design. but I can see this can be requirement. I'm creating an issue for this so that, login logout actions will be stored in Audit Logs. Then you can query it from AbpAuditLogs table and write to your Angular client.