Filtering EntityDataSource on load RRS feed

  • Question

  • User-1425666379 posted

    I really love Dynamic Data, but some key things, mostly how it works with Entity Framework, are really throwing me.

    I think what I want to do should be pretty darn simple:

    My Sales Entity has a relationship (so no Linq to SQL answers [;)]  since there are no FKs ) to a Region Entity. I want my custom ListDetails page to load already filtered by the Region of my choice. (I'll be basing that on the location of the user).

    I'm guessing I use a WhereParameter, or a Where clause to do that in Page_Init(), but I don't know how to do that. I think knowing how to do this with the EntitiyDataSource would solve many of the problems I've been having, all of which have to do with edm relationships vs. foreign keys.

    Can anybody help me with this?

    Monday, September 22, 2008 8:22 PM

All replies

  • User-330204900 posted

    This is what I tried on Northwind with EF

    GridDataSource.WhereParameters.Add(new Parameter("Employees", DbType.String, "Fuller"));

    Which obviously doesn't work but how do you referance the say "LastName" property of the "Employees" entity?

    Also this seems the same wit Linq to SQL

    Tuesday, September 23, 2008 2:01 AM
  • User-1425666379 posted

    Right, this is my problem. How do I use an EF relationship in a situation like this? There is no "DbType.Region".

     I'm continuing to pound my head on this, among other DD/EF related issues, so any help here is HIGHLY valued... :)



    Tuesday, September 23, 2008 12:32 PM
  • User-797310475 posted

    Have you tried the Entity Framework forum?

    Tuesday, September 23, 2008 2:19 PM
  • User-1425666379 posted

    Yes, and I think I may have someone helping on this one now from over there.

    I'm learning both DD and EF at the same time. I have a handful of issues and sometimes it's a little unclear which domain the problem belongs in.

    Tuesday, September 23, 2008 3:01 PM