Advantage Developer Zone

 
 
 

Advantage Knowledgebase Item




Ref No:
120423-2510
Last Modified:
Monday, April 30, 2012
Product:
Advantage Clients ( General )
Category:
Client Environment
Title:
Unable To Get MVC3 To Work With ADS v9.1
Problem Description:
Is it possible to get an Entity Framework with a data model using ASP.NET (MVC3)?
Solution:
ASP.Net MVC3 uses Entity Framework 4. Advantage first introduced support for Entity Famework 4 in version 10.

With versions prior to 10, a 'database-first' approach will work. To do a database first approach, add an "ADO.Net Entity Data Model" in the model folder and generate from the database. Once the model is created be sure to "Build" the project. Once built, add the controller and attach it to the table in the model.

With versions 10+, the database first option as stated above will work, or it can be implement using the code-first approach. For code-first approaches, an additional line of code is needed. Add a line defining the schema name to ::this.

An example of this would be:

<movie.cs>
namespace MvcMovie.Models
{

[Table( "Movie", Schema = "::this" )]
public class Movie
{
...
Was This Item Helpful?