New to .net unsure what I am doing wrong here. I created a c# API project and then used ADO.Net entity mappings. Which looks like it created correct .cs files for the models based on all of my tables. I guess the next step is to create a controller, but I get an error message when that happens.
Model 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; }
}
}
The error message I get when I set this model as the Model Class and the Data Context class is
Unsupported Context Type
The template I was using is API controller with read/write actions, using Entity framework
Here are the steps I used to create a simple MVC API application
From here I was able to call a url;
www.application.com/api/TestController/?id=1
This successfully brought back data from my database.