I might have found something that works
I changed the Entity to inherit from Entity<long>
added
[NotMapped]
public override long Id
{
get { return 0; }
protected set { }
}
change the repo to public class EfCoreEdRepository : EfCoreRepository<DataDbContext, Ed>
I need to access 3 entities that do not have a primary key. the access needed is read only. It looks like I can do it from reading the documentation, but I am having difficulties.
For these entities i just need to show them in a grid and do some paging, filtering and advanced finds. So all I need is GetListAsync
we cannot update to .net 9, because of contract reasons. can we simply update the front-end to 9.1 without any bad side affects? we did update to 9.0.4 to get rid of the console errors for the for loop tracking issues
We will try to dynamically patch the route w/ the route id and see if that works. so instead of putting code to patch the route in the app.component, we will put that code in the component we are navigating to
--UPDATE-- got a little bit further. we have some side effects with the left nav Models always being selected, even when we click on something like Home. thinking we need to unpatch. will give it some more time tomorrow
then, this solution will not work for us. our situation is we have a something like this:
Database Table Column
this first view shows all the databases then the user will select a database to see all the tables then the user select a table to see all the columns
if we cannot have an id as part of the route, then we would need to push navigation state to a service or something akin where state is not held in the routes.
are u talking about this?
logical-model-route-provider.ts
import { RoutesService, eLayoutType } from '@abp/ng.core';
import { APP_INITIALIZER } from '@angular/core';
export const LOGICAL_MODELS_ROUTE_PROVIDER = [
{ provide: APP_INITIALIZER, useFactory: configureRoutes, deps: [RoutesService], multi: true },
];
function configureRoutes(routes: RoutesService): any {
return () => {
routes.add([
{
path: '/logical-models',
name: '::Menu:LogicalModels',
layout: eLayoutType.application,
requiredPolicy: 'Models.Logical',
parentName: '::Menu:Models',
},
]);
};
}
app.component.ts
constructor(
private idleService: IdleService,
private settingTabs: SettingTabsService,
private userMenuService: UserMenuService,
private config: ConfigStateService,
private navItems: NavItemsService,
private ngSelectConfig: NgSelectConfig,
private replaceableComponents: ReplaceableComponentsService,
private routes: RoutesService,
private modal: NgbModal,
private oAuthService: OAuthService,
private stickyFilterService: StickyFilterService,
private dynamicIdService: DynamicIdService,
) {
this.replaceableComponents.add({
component: FooterComponent,
key: eThemeLeptonXComponents.Footer,
});
this.replaceableComponents.add({
component: BreadcrumbComponent,
key: eThemeLeptonXComponents.Breadcrumb,
});
this.routes.patch('::Menu:LogicalModels', {
path: '/logical-models/:lModelId/logical-tables',
});
this.ngSelectConfig.appendTo = 'body';
}
logical-models-routing.module.ts
const routes: Routes = [
{
path: '',
component: LogicalModelsComponent,
canActivate: [authGuard, permissionGuard],
children: [
{
path: ':lModelId/logical-tables',
component: LogicalTablesComponent,
canActivate: [authGuard, permissionGuard],
},
],
},
logical-models.component.ts
navTables(record: LogicalModelDto): void {
this.router.navigate(['logical-models', record.id, 'logical-tables']);
}
Having some issues w/ your solution, it is not working for me.
tried patch and i tried add. i did not see anything in the left nav when i did the patch. when i did the add i saw the new left nav item. also tried when using the angular child route and not child route
both patch and add, the left nav does not remain selected
in your solution will there be a item in the left nav?
I have a left nav that shows the pages, looks screen shot 1. Then on the 'Data Transformation page there is an row action to show detail (screen shot 2) and i select that action. The left nav is no longer showing a selected menu item, even though the detail page is part of the route (yes the show detail page is not in the left nav).
Can I programmatically make the the left nav show like in screen shot 1? Data Transformation and Steps shown as selected? I tried using abp NavbarService and just expanding it by the below code. (Yes it only does part of what I want, but it doesn't work). Maybe i need to mark something dirty, call an update/refresh? Maybe this service is not designed to do this?
const item = this.navItems.find(item => item.text === 'Data Transformation');
item.expanded = true;
item.selected = true;
}