you did answer: Exception message and full stack trace! i think it is a BUG
for the 2nd part, what you mean add new endpoint to return dto with deletion info?
public override async Task<IdentityUserDto> GetAsync(Guid id) { using (DataFilter.Disable<ISoftDelete>()) return await base.GetAsync( id ); }
i have a question related to this if I want to display all the users in the table as admin, if I disabled the filter for ISoftDeleted, unfortunately, the IdentityUserDto doesn't return IsDeleted and deletionTime with return data, how to fix this?
public override async Task<PagedResultDto<IdentityUserDto>> GetListAsync(GetIdentityUsersInput input) { using (DataFilter.Disable<ISoftDelete>()) return await base.GetListAsync(input); }
sorry I don't have the privilege to send the project code,simpl just add a new table as below:
public class Person: FullAuditedAggregateRoot<Guid>, IMultiTenant
{
public virtual Guid? TenantId { get; set; }
public virtual long PersonNo { get; set; }
public virtual string Name { get; set; }
public virtual bool IsCitizen { get; set; }
[CanBeNull]
public virtual string? NationalNo { get; set; }
protected Person()
{
}
}
the configuration in the dbcontext as below:
builder.Entity<Person>(b =>
{
b.ToTable(BstCoreDbProperties.DbTablePrefix + "Persons", BstCoreDbProperties.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.TenantId).HasColumnName(nameof(Person.TenantId));
b.Property(x => x.Name).HasColumnName(nameof(Person.Name1)).IsRequired();
b.HasIndex(x => new { x.TenantId, x.PersonNo }).IsUnique();
b.HasIndex(x => new { x.TenantId, x.Name }).IsUnique();
b.HasIndex(x => new { x.TenantId, x.NationalNo });//.IsUnique();
b.Property(o => o.PersonNo)
.HasDefaultValueSql("NEXT VALUE FOR PersonNo").ValueGeneratedOnAdd();
});
builder.HasSequence<long>("PersonNo").StartsAt(100000001).IncrementsBy(1);`
once you created this table, make a test to add two records with different tenant names, and check the generated sequence no (PersonNo) , it should be 100000001 for tenant#1, and 100000001 for tenant#2 but the output is 100000001 for tenant#1 and 100000002 for tenant#2
first thx for your replay,
but it seems you didn't get my point, the application is multi-tenancy according to Abp.io's practice
so we have a tenant for each client (shared db),
now we have the table name "Account", and we should create Sequences for this table in the field "AccountNo".
the above code will generate the same sequence for all clients, but it should be for each client(tenant) sequence
Hi,
What database are you using? ** SQL Server**
Note that the specific SQL used to generate a value from a sequence is database-specific; the above example works on SQL Server but will fail on other databases. Consult your specific database's documentation for more information.
See: https://learn.microsoft.com/en-us/ef/core/modeling/sequences#basic-usage
noting i use SQL server , my question here is there any way to achieve the required sequence per tenant?
how we can create multiple sequences (One for each tenant)? for eaxample:
| Tenant |AccountNo | | --- | --- | | TenantA | 1000001 |customerX| | TenantA| 1000002 | customerX| | TenantB| 1000001 | customerX| | TenantB | 1000002 | CustomerX |
if we use the following code , it will generate a same sequence for all tenants
b.Property(o => o.AccountNo) .HasDefaultValueSql("NEXT VALUE FOR AccountNo").ValueGeneratedOnAdd(); builder.HasSequence<long>("AccountNo").StartsAt(1000001).IncrementsBy(1);
using Volo.Abp.EntityFrameworkCore.Modeling;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
namespace BstCore.EntityFrameworkCore;
[ConnectionStringName(BstCoreDbProperties.ConnectionStringName)]
public interface IBstCoreDbContext : IEfCoreDbContext
{
DbSet<PersonTitle> PersonTitles { get; set; } **= null!;** <-----compiler : the error in the generated code ,interface property cannot have an initializer
DbSet<Neighborhood> Neighborhoods { get; set; } //= null!;
DbSet<Town> Towns { get; set; }//= null!;
DbSet<District> Districts { get; set; }// = null!;
DbSet<Region> Regions { get; set; }//= null!;
DbSet<Country> Countries { get; set; }// = null!;
/* Add DbSet for each Aggregate Root here. Example:
* DbSet<Question> Questions { get; }
*/
}
noting that no error in the abp suite log file! just waiting
public class PersonTitlesAppServiceTests : BstCoreApplicationTestBase
{
private readonly IPersonTitlesAppService _personTitlesAppService;
private readonly IRepository<PersonTitle, int> _personTitleRepository;
public PersonTitlesAppServiceTests()
{
_personTitlesAppService = GetRequiredService<IPersonTitlesAppService>();
_personTitleRepository = GetRequiredService<IRepository<PersonTitle, int>>();
}
[Fact]
public async Task GetListAsync()
{
// Act
var result = await _personTitlesAppService.GetListAsync(new GetPersonTitlesInput());`
it should be fixed as the following code
public abstract class PersonTitlesAppServiceTests<TStartupModule> : BstCoreApplicationTestBase<TStartupModule>
where TStartupModule : IAbpModule
{}
I’ve updated my app to abp version 8.0.0-rc.1 But I got the following error: [12:28:49 ERR] ABP-LIC-0013 - License exception: ABP-LIC-0023: An error occured while calling the license server! License check communication failed! The response was not successful: 400 - Bad Request [12:28:49 ERR] ABP-LIC-0013 - License exception: ABP-LIC-0023: An error occured while calling the license server! License check communication failed! The response was not successful: 400 - Bad Request [12:28:49 INF] Saving healthchecks configuration to database [12:28:50 ERR] ABP-LIC-0013 - License exception: ABP-LIC-0023: An error occured while calling the license server! License check communication failed! The response was not successful: 400 - Bad Request [12:28:50 ERR] ABP-LIC-0013 - License exception: ABP-LIC-0023: An error occured while calling the license server! License check communication failed! The response was not successful: 400 - Bad Request [12:28:50 DBG] Waiting to acquire the distributed lock for saving external localizations... ABP-LIC-0003 - No modules found! There's no module found for your organization. Contact to license@abp.io for more information. [12:23:57 INF] User profile is available. Using 'C:\Users****\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest. [12:23:57 ERR] ABP-LIC-0013 - License exception: ABP-LIC-0023: An error occured while calling the license server! License check communication failed! The response was not successful: 400 - Bad Request
i already have my current apps running since version 6 and last time i updated it from 7.3.0 to 7.4.0-rc.3 using using the command abp update cmd
<PackageReference Include="Volo.Abp.Autofac" Version="7.4.0-rc.3" /> <PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="7.4.0-rc.3" /> <PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="7.4.0-rc.3" /> <PackageReference Include="Volo.Abp.Swashbuckle" Version="7.4.0-rc.3" /> <PackageReference Include="Volo.Abp.FeatureManagement.Web" Version="7.4.0-rc.3" /> <PackageReference Include="Volo.Abp.Account.Pro.Public.Web.OpenIddict" Version="7.4.0-rc.3" /> <PackageReference Include="Volo.Abp.Account.Pro.Admin.Web" Version="7.4.0-rc.3" /> <PackageReference Include="Volo.Abp.AuditLogging.Web" Version="7.4.0-rc.3" /> <PackageReference Include="Volo.Abp.Identity.Pro.Web" Version="7.4.0-rc.3" /> <PackageReference Include="Volo.Abp.OpenIddict.Pro.Web" Version="7.4.0-rc.3" /> <PackageReference Include="Volo.Abp.LanguageManagement.Web" Version="7.4.0-rc.3" /> <PackageReference Include="Volo.Saas.Host.Web" Version="7.4.0-rc.3" /> <PackageReference Include="Volo.Abp.TextTemplateManagement.Web" Version="7.4.0-rc.3" /> <PackageReference Include="Volo.Abp.Gdpr.Web" Version="7.4.0-rc.3" /> <PackageReference Include="Volo.Abp.LeptonTheme.Management.Web" Version="7.4.0-rc.3" />
for the details tab in edit user as i said, we already override the razor page, so this new tab didn't appear, i just want the razor page for the details to add it in our existing override page
Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.
If you're creating a bug/problem report, please include the following:
after i upgraded to v7.4.0-rc.3 , and published my apps, the app couldn't show the modal page for editing user or role permissions or personal data (all related to identity), the log file as the following
2023-09-20 10:23:51.108 +03:00 [ERR] An unhandled exception has occurred while executing the request.
System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.HttpUtility, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
File name: 'System.Web.HttpUtility, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
at AspNetCoreGeneratedDocument.Pages_AbpPermissionManagement_PermissionManagementModal.<ExecuteAsync>b__24_1()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at AspNetCoreGeneratedDocument.Pages_AbpPermissionManagement_PermissionManagementModal.<ExecuteAsync>b__24_1()
at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.GetChildContentAsync(Boolean useCachedResult, HtmlEncoder encoder)
at Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal.AbpModalTagHelperService.ProcessAsync(TagHelperContext context, TagHelperOutput output)
at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>g__Awaited|0_0(Task task, TagHelperExecutionContext executionContext, Int32 i, Int32 count)
at AspNetCoreGeneratedDocument.Pages_AbpPermissionManagement_PermissionManagementModal.<ExecuteAsync>b__24_0()
at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.GetChildContentAsync(Boolean useCachedResult, HtmlEncoder encoder)
at Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)
at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>g__Awaited|0_0(Task task, TagHelperExecutionContext executionContext, Int32 i, Int32 count)
at AspNetCoreGeneratedDocument.Pages_AbpPermissionManagement_PermissionManagementModal.ExecuteAsync()
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts)
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable1 statusCode) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable
1 statusCode)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Volo.Abp.AspNetCore.Uow.AbpUnitOfWorkMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Builder.ApplicationBuilderAbpOpenIddictMiddlewareExtension.<>c__DisplayClass0_0.<<UseAbpOpenIddictValidation>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Volo.Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|8_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
2023-09-20 10:24:41.334 +03:00 [ERR] ---------- RemoteServiceErrorInfo ----------
{
"code": null,
"message": "An internal error occurred during your request!",
"details": null,
"data": {
"ActivatorChain": "Pages.Gdpr.PersonalData.Index"
},
"validationErrors": null
}
2023-09-20 10:24:41.335 +03:00 [ERR] An exception was thrown while activating Pages.Gdpr.PersonalData.Index.
Autofac.Core.DependencyResolutionException: An exception was thrown while activating Pages.Gdpr.PersonalData.Index.
---> Autofac.Core.DependencyResolutionException: None of the constructors found on type 'Pages.Gdpr.PersonalData.Index' can be invoked with the available services and parameters:
Cannot resolve parameter 'Volo.Abp.Gdpr.IGdprRequestAppService gdprRequestAppService' of constructor 'Void .ctor(Volo.Abp.Gdpr.IGdprRequestAppService)'.
also,after upgrade i can't open the user edit modal, knowing that we override it and we noted in the newer version there is a new tab "Details" , could you give me the new tab razor page code
my current page as the following
<form method="post" asp-page="/Identity/Users/EditModal"> <abp-modal> <abp-modal-header style="width:130%" title="@L["Edit"].Value"></abp-modal-header> <abp-modal-body style="width:130%"> <abp-tabs name="create-user-modal-tabs"> .. </abp-tab> @if (Model.Roles.Any()) { <abp-tab name="Roles" title="@L.GetString("Roles{0}", Model.Roles.Count(r => r.IsAssigned))"> .. </abp-tab> } @if (Model.OrganizationUnits.Any()) { <abp-tab name="OrganizationUnits" title="@L.GetString("OrganizationUnits{0}", Model.OrganizationUnits.Count(r => r.IsAssigned))"> ... </abp-tab> } <abp-tab name="your-custom-tab" title="@L["ExtraProperties"].Value"> ... </abp-tab> <abp-tab name="SocialMedia-tab" title="@L["SocialMedia"].Value"> ... </abp-tab> </abp-tabs> </abp-modal-body> <abp-modal-footer style="width:130%" buttons="@(AbpModalButtons.Cancel | AbpModalButtons.Save)"></abp-modal-footer> </abp-modal> </form>
thanks in advance