Using EntityReference to get the guid of records for lookup fields
foreach (Entity act in result.Entities)
{
Guid Value = (Guid)act.Attributes["accountid"];
EntityReference Account = new EntityReference("account", Value);
newAccountAuditor["gems_account"] = Account;
}