0

We are currently working on a application which uses entity framework 6, database first approach. There are a few tables we need to pull in, joining them, but they have many columns which we do not want to pull in. I can delete the columns in the edmx but then they regenerate whenever we update the edmx, is there anyway to avoid this?

2

1 Answer 1

2

Well, let it pull all the columns. Still you can select only few columns or the columns you need while displaying or passing as model using a LINQ query Select() method and project to a anonymous type.

Other than that, DB First model UI also gives you facility to import Views and stored procedure. That means, whichever customized data you want you can pull the required SQL to a create view ... statement or create procedure... statement and have it imported using Entity Framework.

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

1 Comment

I agree. Either create a static typed model to project onto, or project onto an anonymous type using the Select method

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.