Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

updating table in entity model

Posted on 2016-08-23
3
Medium Priority
?
76 Views
Last Modified: 2016-08-23
I'm using ASP.NET MVC 5 and Entity Framework 6 database first model.

I’m using SQL Server database.

I have some sql server tables called the following:

Table1
Table2

I have an entity model called MyModel.edmx

If I change the name of my sql server tables to

Table1TestData
Table2TestData

and then I updated my model to uses these new models

I have these new model classes

Table1TestData.cs
Table2TestData.cs

In the c# code of my application I have a bunch of pages that were referencing the original model classes from my model.

Table1.cs
Table2.cs

So I need to go into my C# code and update all the items referencing Table1.cs and have them reference Table1TestData.cs

Is there a way to list all the pages that are referencing the old model classes?
So I can update them to reference to new model classes.
0
Comment
Question by:maqskywalker
  • 2
3 Comments
 
LVL 64

Accepted Solution

by:
Fernando Soto earned 2000 total points
ID: 41767216
In Visual Studio main menu choose : Edit -> Find and Replace -> Find in Files, Then in the Find and Replace dialog box set the Find What textbox to the table name that needs to be replaced and select Entire Solution in the Look in combo box and then click Find All button. In the results window will show all the places it is in. Double clicking on one of the result will open that line in the code or you can use the replace option and have the editor replace them for you.
0
 
LVL 1

Author Closing Comment

by:maqskywalker
ID: 41767415
Thanks.
0
 
LVL 64

Expert Comment

by:Fernando Soto
ID: 41767424
Not a problem maqskywalker, glad  to help.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question