简体   繁体   English

实体框架核心使用预先存在的ID密钥

[英]Entity Framework Core Use Pre-Existing ID Key

我有很多使用预设主键的用户,我在创建时是否有任何方法可以分配这些键?

I had pretty much the same question about 6 months ago here . 大约六个月前,我在这里有几乎相同的问题。 The solution was for EF7 and should work flawlessly in EF Core. 该解决方案适用于EF7,并且可以在EF Core中完美运行。

Next time try to do a bit more research first. 下次尝试首先进行更多研究。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用预先存在的iqueryable过滤实体框架上的另一个iqueryable - Using pre-existing iqueryable to filter another iqueryable on Entity Framework 是否可以将 Entity Framework Core 与没有主键的表上的现有数据库一起使用? - Is it possible to use Entity Framework Core with existing database on tables with no primary key? Entity Framework Core:表“Users”中的列“Id”是一种无效的类型,不能用作索引中的键列 - Entity Framework Core: Column 'Id' in table 'Users' is of a type that is invalid for use as a key column in an index 如何更改 Entity Framework Core 中的 Id 主键命名约定? - How to change Id primary key name convention in Entity Framework Core? Net Core:通用存储库主 ID 实体框架中的关键性能 - Net Core: Generic Repository Primary Id Key Performance in Entity Framework 如何在Visual Studio for Mac中打开一个预先存在的.NET Core应用程序? - How do I open a pre-existing .NET Core application in Visual Studio for Mac? 将现有表添加到EF Core 2.0中的代码优先迁移 - Add pre-existing table to code-first migration in EF Core 2.0 使用预先存在的私钥对文件签名以创建证书(C#) - Using a pre-existing private key to sign file to create a certificate (C#) 打开预先存在的 excel 文件 - Opening a pre-existing excel file 从现有属性导出MEF - MEF Exporting From Pre-existing attribute
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM