.net 的新手不确定我在这里做错了什么。我创建了 ac# API 项目,然后使用了 ADO.Net 实体映射。看起来它根据我的所有表为模型创建了正确的 .cs 文件。我想下一步是创建一个控制器,但是当发生这种情况时我会收到一条错误消息。
模型 1
namespace GoogleMapsAPIv1.Models
{
using System;
using System.Collections.Generic;
public partial class Table1
{
public string COUNTRY_ID { get; set; }
public string PROVINCE_ID { get; set; }
public string CITY { get; set; }
public string COUNTY { get; set; }
public string POSTAL_CODE { get; set; }
public Nullable<decimal> LATITUDE { get; set; }
public Nullable<decimal> LONGITUDE { get; set; }
public Nullable<decimal> DISTANCE_CACHED { get; set; }
public string FIPS_PROVINCE_CODE { get; set; }
public string FIPS_COUNTY_CODE { get; set; }
public Nullable<System.DateTime> CREATED_DATE { get; set; }
public Nullable<System.DateTime> LAST_MODIFIED_DATE { get; set; }
public string SPATIAL_DATA { get; set; }
public string TIMEZONE_ID { get; set; }
public Nullable<int> GMT_OFF_SET { get; set; }
public string SPATIAL_BOUNDARY { get; set; }
public int DK_COUNTRY_ID { get; set; }
}
}
当我将此模型设置为模型类和数据上下文类时收到的错误消息是
Unsupported Context Type
我使用的模板是具有读/写操作的 API 控制器,使用实体框架