L
Luna
I have a Tags table that is shared by Photos and Videos tables
Photos
-----
Id
Name
.....
Videos
-----
Id
Name
.....
Tags
------
Id
ParentId
ParentType
I would like to write a function that returns the parent object(photo, or
video) based on tagId
the parameter tableData could be
from p in data.Photos or
from v in data.Videos
public void GetParentData(int tagId, IQueryable tableData)
{
var temp = from d in tableData
where (from t in data.Tags select
t.ParentId).Contains(d.id)
select d;
}
Im not sure how to write this in LINQ if it's even possible.
With T-SQL I can just replace the tablename string with the string parameter
passed in.
thx
Luna
Photos
-----
Id
Name
.....
Videos
-----
Id
Name
.....
Tags
------
Id
ParentId
ParentType
I would like to write a function that returns the parent object(photo, or
video) based on tagId
the parameter tableData could be
from p in data.Photos or
from v in data.Videos
public void GetParentData(int tagId, IQueryable tableData)
{
var temp = from d in tableData
where (from t in data.Tags select
t.ParentId).Contains(d.id)
select d;
}
Im not sure how to write this in LINQ if it's even possible.
With T-SQL I can just replace the tablename string with the string parameter
passed in.
thx
Luna