当前位置:Gxlcms >
数据库问题 >
建立EF访问数据库架构时,出现One or more validation errors were detected during model generation
建立EF访问数据库架构时,出现One or more validation errors were detected during model generation
时间:2021-07-01 10:21:17
帮助过:22人阅读
System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System;
namespace Feng.Entity
{
[Serializable]
[Table("dict_sample")]
public class Dict_sample
{
[Key]//必须要添加的特性,要和数据库主键对应
[Column(
"sam_id")]
[StringLength(12)]
public string Sam_id
{ get;
set; }
[Column("sam_name")]
[StringLength(50)]
public string Sam_name
{ get;
set; }
[StringLength(18)]
[Column("sam_code")]
public string Sam_code
{ get;
set; }
[StringLength(12)]
[Column("sam_incode")]
public string Sam_incode
{ get;
set; }
[StringLength(12)]
[Column("sam_type")]
public string Sam_type
{ get;
set; }
[StringLength(18)]
[Column("sam_py")]
public string Sam_py
{ get;
set; }
[StringLength(18)]
[Column("sam_wb")]
public string Sam_wb
{ get;
set; }
[Column("sam_seq")]
public int Sam_seq
{ get;
set;
}
[StringLength(1)]
[Column("sam_del")]
public string Sam_del
{ get;
set; }
[StringLength(18)]
[Column("sam_custom_type")]
public string Sam_custom_type
{ get;
set; }
[StringLength(100)]
[Column("sam_trans_code")]
public string Sam_trans_code
{ get;
set; }
}
}
建立EF访问数据库架构时,出现One or more validation errors were detected during model generation
标签:.com uri using length not text mod one 原因