I have a table with 4 columns, LoginID, LastName, FirstName, Email. The data for LoginID was populated from an other table. I have to write a small routine to update this table, by sending in the LoginID and with help of IDirectory routines, get the Lastname, firstname and email. This is what I’m attempting to do, but getting confused with the right syntax.
using (TSADRequestEntities context = UnityHelper.Resolve<TSADRequestEntities>())
{
var fpvalues = context.FOCALPOINTs.ToList();
foreach (var item in fpvalues)
{
IEnumerable<UserInfo> query = UnityHelper.Resolve<IUserDirectory>().Search(item.LoginID);
//Here, FocalPoint is the table that has the loginID and the other fields
//I need to update. the query shld now hv info on lastname etc..how do I
//retrieve that value and update the table?
}
}
Its a bit hard to tell what you mean by getting confused with the right syntax, but your next step should be
within the
foreachloop. Then, ifinfo != null, copy the required values to theitemobject. After theforeachclose with context.SaveChanges().