Open gaotang opened 4 years ago
具体我没有调试源码,就生成不了,我只做三步操作
更改配置文件,
添加数据库表实体类,如下:
public class School : BasePoco
{
[Display(Name = "学校编码")]
[Required(ErrorMessage = "{0}是必填项")]
[RegularExpression("^[0-9]{3,3}$", ErrorMessage = "{0}必须是3位数字")]
public string SchoolCode { get; set; }
[Display(Name = "学校名称")]
[StringLength(50, ErrorMessage = "{0}最多输入{1}个字符")]
[Required(ErrorMessage = "{0}是必填项")]
public string SchoolName { get; set; }
//定义附件列表
public List
DataAccess 项目中添加引用,
//public DbSet
在 2020-01-11 12:35:18,"liuliang-wt" notifications@github.com 写道:
目前文件上传只能登陆用户才可以 生成数据库时候报的具体错误是什么?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
sorry,一直忘了回复了。 你的School类继承了BasePoco,默认他是Guid的主键,所以你SchoolPhoto表里的外键应该定义成 public Guid SchoolId, 而不是int。 在你启动项目的时候,注意看vs里的输出,他不能启动的时候肯定给你输出了错误,看那些错误描述可以比较快速的发现问题。
ths, 没有细想,直接抄文档了。vs里的输出里面没有注意,多谢指出
在 2020-02-02 19:33:13,"liuliang-wt" notifications@github.com 写道:
sorry,一直忘了回复了。 你的School类继承了BasePoco,默认他是Guid的主键,所以你SchoolPhoto表里的外键应该定义成 public Guid SchoolId, 而不是int。 在你启动项目的时候,注意看vs里的输出,他不能启动的时候肯定给你输出了错误,看那些错误描述可以比较快速的发现问题。
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
有两个问题: