EF数据库连接时候出错

users: EntityType: EntitySet 'users' is based on type 'UserModel' that has no keys defined.

TreeLayer.DAL.UserModel: : EntityType 'UserModel' has no key defined. Define the key for this EntityType.

users: EntityType: EntitySet 'users' is based on type 'UserModel' that has no keys defined.


在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: SQL Network Interfaces, error: 50 - 发生了本地数据库运行时错误。指定的 LocalDB 实例不存在。

)

解决方案:执行命令sqllocaldb start v11.0

作者:Elaine
交流QQ:392989505
原文地址:https://www.cnblogs.com/ITGirl00/p/3812910.html