CodeOnly

关于设置[Key]标志

要先添加 程序集的引用

在添加  using System.ComponentModel.DataAnnotations; 命名控件

原文地址:https://www.cnblogs.com/since87/p/3129399.html