I was able to reproduce the problem and as far as I can see OData path with composite keys where one of the keys is string cannot be found. The same works normally for example with Northwind OrderDetails where the composite key is from two integer fields. I'll continue to research the problem and I'll post here when I have more info.
UPDATE: The issue is related to .NET6/OData 8.x, the same works normally with .NET5/OData 7.x!
Checked using the latest update. The Issue with key of string+integer is resolved. Still there is another table with date+integer key for that the error persists
CREATE TABLE [dbo].[DayBegin](
[LocID] [int] NOT NULL,
[CurrDate] [datetime] NOT NULL,
[DayEnd] [bit] NULL,
[DateLock] [bit] NULL,
[Holiday] [bit] NULL,
CONSTRAINT [PK_DayBegin] PRIMARY KEY CLUSTERED
(
[LocID] ASC,
[CurrDate] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
Most probably the issue is related to the DateTime keys in general - never seen such before. I’ll review what code is generated and I’ll post here when I have more info.