1

I want to create an ADO.NET model for Azure Database and it creates with success but I can't see the models.

This is how it looks in Visual Studio:

EDMX Model

And still in my folder the models are created but I don't see them.

Can you help me?

My Models Folder

1
  • In visual studio solution explorer expand Employee.edmx file you will see Employee.Designer.cs file. Under that you will find every thing. Here is an image of my previously done project . First try this. I have code example and can solve this if you can expand the edmx file. If not then there is a issue with your edmx file. You have to create object with the enitity name wich is under the tree of the edmx file. With that model you have to write LINQ query to retrieve data from database through your model. Commented May 3, 2020 at 18:04

1 Answer 1

1

The EDMX is a representation of the model - but you have to run the .tt files in order for them to analyze your EDMX to create the model.

UPDATE: The .tt file should be under the .edmx file in your Solution Explorer.

To do this, right-click the .tt and chose to Run (can't remember exactly what the command is) but it will execute your changes to the EDMX and create the various .cs or .vb classes for you. In your case, it's the Employee.Context.tt file that you need to run/execute.

Be careful if you change the generated .cs or .vb files that are created, as if you re-run the .tt file, it'll drop and recreate your code, potentially losing any customisations.

UPDATE: I've found you this really good explanation of each stage which might help.

Hope this helps.

Sign up to request clarification or add additional context in comments.

2 Comments

My issue is that i can't see the Employee.Context.tt file in Visual.
Ah, gotcha. I've updated the post to help, hopefully.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.