Reputation: 1
I have the following code inside my asp.net mvc web application :-
public void syncWithEX()
{
var EXresource = entities.Resources.Select(g => new
{
EXID = g.RESOURCEID,
CurrentEXSiteID = g.ResourceLocation.SITEID
}).ToDictionary(a => a.EXID, a => a.CurrentEXSiteID);
var technology = ITSys.Technologies.Select(g => new
{
ID = g.TechnologyID,
EXID = g.EXID
}).ToDictionary(a => a.ID, a => a.EXID);
var server = ITSys.ITSYSServers.Where(a => !a.Technology.IsDeleted && a.Technology.IsCompleted);
foreach (var s in server)
{
long? EXid = technology[s.ITSYSServerID];
if (EXresource.ContainsKey[EXid.Value] )
{
long? CurrentEXsiteid = EXresource[EXid.Value];
if (CurrentEXsiteid != s.EXSiteID)
{
s.EXSiteID = CurrentEXsiteid.Value;
ITSys.Entry(s).State = EntityState.Modified;
}
}
}
But i am getting the following error :
Cannot apply indexing with [] to an expression of type 'method group
on the following code:
if (EXresource.ContainsKey[EXid.Value] )
Upvotes: 0
Views: 1265