Hi,
Please see: https://github.com/abpframework/abp/issues/4388, https://github.com/abpframework/abp/issues/4350. They can help you.
Hi,
if it is a simple service and not use database,you can just create libary project , like volo.abp.automapper
.
Hi,
Example (c# client):
var client = new HttpClient();
var disco = await client.GetDiscoveryDocumentAsync(_configuration["IdentityClients:Default:Authority"]);
if (disco.IsError)
{
Console.WriteLine(disco.Error);
return;
}
// request token
var tokenResponse = await client.RequestClientCredentialsTokenAsync(new ClientCredentialsTokenRequest()
{
Address = disco.TokenEndpoint,
ClientId = _configuration["IdentityClients:Default:ClientId"],
ClientSecret = _configuration["IdentityClients:Default:ClientSecret"],
Scope = _configuration["IdentityClients:Default:Scope"]
});
using (var httpClient = new HttpClient())
{
httpClient.SetBearerToken(tokenResponse.AccessToken);
var url = _configuration["RemoteServices:MyProjectName:BaseUrl"] +
"api/MyProjectName/sample/authorized";
var responseMessage = await httpClient.GetAsync(url);
if (responseMessage.IsSuccessStatusCode)
{
var responseString = await responseMessage.Content.ReadAsStringAsync();
Console.WriteLine("Result: " + responseString);
}
else
{
throw new Exception("Remote server returns error code: " + responseMessage.StatusCode);
}
}
Hi,
Are you logged in to the application? Can you share the request message? thanks.
Hi,
You don't need do this, because abp has completed the configuration.
See https://github.com/abpframework/abp/issues/1414#issuecomment-508818941.
If you still want add navigation properties, please do this:
Entity:
public class UnitCategory : Entity<Guid>
{
public UnitCategory(Guid id)
{
Id = id;
}
public List<OrganizationUnit> OrganizationUnits { get; set; }
}
DbContext:
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
/* Configure the shared tables (with included modules) here */
builder.Entity<AppUser>(b =>
{
b.ToTable(AbpIdentityDbProperties.DbTablePrefix +
"Users"); //Sharing the same table "AbpUsers" with the IdentityUser
b.ConfigureByConvention();
b.ConfigureAbpUser();
/* Configure mappings for your additional properties
* Also see the qaEfCoreEntityExtensionMappings class
*/
});
// add this..
builder.Entity<OrganizationUnit>(b =>
{
b.ToTable(AbpIdentityDbProperties.DbTablePrefix + "OrganizationUnits");
b.ConfigureByConvention();
b.Property(ou => ou.Code).IsRequired().HasMaxLength(OrganizationUnitConsts.MaxCodeLength)
.HasColumnName(nameof(OrganizationUnit.Code));
b.Property(ou => ou.DisplayName).IsRequired().HasMaxLength(OrganizationUnitConsts.MaxDisplayNameLength)
.HasColumnName(nameof(OrganizationUnit.DisplayName));
b.HasMany<OrganizationUnit>().WithOne().HasForeignKey(ou => ou.ParentId);
b.HasMany(ou => ou.Roles).WithOne().HasForeignKey(our => our.OrganizationUnitId).IsRequired();
b.HasIndex(ou => ou.Code);
});
builder.Ignore<OrganizationUnitRole>();
builder.Configureqa();
}
DbContextModelCreatingExtensions:
builder.Entity<UnitCategory>(b =>
{
b.ToTable("UnitCategory");
b.HasMany(x => x.OrganizationUnits).WithOne().HasForeignKey("UnitCategoryId");
b.ConfigureByConvention();
});
EfCoreEntityExtensionMappings:
ObjectExtensionManager.Instance
.MapEfCoreProperty<OrganizationUnit, Guid?>(
"UnitCategoryId",
b => b.HasMaxLength(64)
);
Hi,
You can customize the page, see : https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Overriding-User-Interface.
If you are using MVC UI, you can use virtual file explorer to see dashboard page source code.
Volo.Abp.Http.Client.AbpRemoteCallException
I see you are using remote service, You need to disable the multi-tenant filter in the service implementation. like this:
public async Task<Unit> GetAsync(Guid id, bool ignoreTenant = false)
{
if(ignoreTenant){
using (_dataFilter.Disable<IMultiTenant>())
{
//query...
}
}
else{
// query...
}
}
Hi,
There is an example to help you : https://github.com/abpframework/abp-samples/tree/master/DocumentationSamples/CustomApplicationModules.
Hi,
You can two options:
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiThemeSharedModule>.....
code.