I have one database table name as:DrippingPerformer
Fields:
DrippingPerformerId,ActivistId,username
1 11 abc
2 11 abc
3 12 xyz
4 13 lmn
5 14 lmn
Table 2:Dripping
ActivistId,name
11 rr
12 tt
13 uu
14 pp
Now i want to get all DrippingPerformer Whose ActivistId is 11,12,13.
I have created 1 view for this:
CREATE VIEW [dbo].[View1]
AS
SELECT dbo.DrippingPerformer.DrippingPerformerId,dbo.DrippingPerformer.ActivistId,
FROM dbo.DrippingPerformer INNER JOIN dbo.Dripping ON dbo.DrippingPerformer.ActivistId = dbo.Dripping.ActivistId
Now from this i want to get all DrippingPerformer Whose ActivistId is 11,12,13.
This is my code:
public IQueryable GetData(string Ids)
{
//Here id contains 11,12,13.
List<int> actions = Ids.Split(',').Select(int.Parse).ToList();
var context = new DataContext();
var q = from g in context.MyView
where
actions.Contains((int)g.ActivistId)
select g;
return q;
}
But here in above query i dont want to use contains.So is there any better alternative than this??
can anybody provide me better alternative than this??