An error occurred while accessing the Microsoft.Extensions.Hosting services. Continuing without the application service provider. Error: The entity type 'TelemetryData' requires a primary key to be defined. If you intended to use a keyless entity type call 'HasNoKey()'.
不能用联合主键吗? 明明定义了
modelBuilder.Entity<TelemetryData>().HasKey(c => new { c.DeviceId, c.KeyName, c.DateTime });
但没有效果。An error occurred while accessing the Microsoft.Extensions.Hosting services. Continuing without the application service provider. Error: The entity type 'TelemetryData' requires a primary key to be defined. If you intended to use a keyless entity type call 'HasNoKey()'.