0

I have two tables that I can't rename in SQL server at this point. One is tblVideo and the other is tblVideos (unfortunate naming I know, don't get me started). The table tblVideo has already been imported with pluralization on. I want to import tblVideos now, but when I do it names the table tblVideo1 and I absolutely do not want to use a numbered table name.

I renamed the entity to tblVehicleVideoClip in the edmx UI.

enter image description here

When I pull the entity it still uses the name tblVideo1 (or tblVideos1 if plural). Only the resulting object that's returned is named tblVehicleVideoClip.

List<tblVehicleVideoClip> list = db.tblVideos1.ToList();

How do I get the db.tvlVideos1 to instead use db.tblVehicleVideoClips? I keep trying to edit the edmx file, but when I do the edmx display says that the xml was modified and it can no longer show me the nice UI display.

1
  • Ah, your comment gave me the clue I needed. Entity Set name was the field that needed to be changed. Thank you. And yes, I agree those tbl* prefixes really need to go. If you post that in the answer to the question I'll mark it as the correct answer. Commented Mar 9, 2018 at 21:55

1 Answer 1

2

You can change the entity name in the EDMX designer, but also the entity set name, i.e. the name of the DbSet property in the context:

enter image description here

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

Comments

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.