c# - Adding where clause to index method of scaffolded controller ASP.NET MVC with EF -


I have a project model and an actor model - a project can include many artists for my actor controller Trying to modify lofty scenes so that an ID can be sent to the index and to make the method so that only the actor (index) can be added for the current project or (create)

Here I start for the index method and I'm not sure where to add the clause. N.B. I am passing in the id as the parameter of the index from the URL.

(Sorry, this is a basic question, I am goggling, but no answer can be found).

Thank you!

  Private JustSpecItAppContext db = New JustSpecItAppContext (); // GET: Actors 1 Public Performance Index () {Return View (db.Actors.ToList ()); }  

try this: -

  public actions Index (int award id) {return view (db.actors.firstor default (a => an id == actor id)); }  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -