Check if the data returned by the sql table contains decimal place values ​​in linq?


I want to return only those data from sql table which contains specific values from list.How can i do that ?

  List<decimal> userHeirarchyId = new List<decimal>();
  List<decimal> userGroupId = new List<decimal>();

 //Get groups based on user
 string userGroupIds = (from ucp in db.UserControlPrivileges
                        where ucp.UserId == (decimal)AMSECSessionData.userId
                        select ucp.GroupIds).FirstOrDefault().ToString();
 userGroupId = userGroupIds.Split(',').Select(x => decimal.Parse(x)).ToList();

 //Get heirarchy based on company and usergroup
 userHeirarchyId = db.Groups
  =>stuck here      && x.GroupId.contains(userGroupIds ))

Any help will be appreciated..

Try this. Change the order how you're using Contains like 'your compare list'.Contains(member name)

var userHeirarchyId = db.Groups
                   .Where(x=> x.Hierarchy.CompanyId == (decimal)AMSECSessionData.companyId
                   && userGroupIds.Contains(x.GroupId))