title: Fake Xrm Easy: How to emulate a plugin's behaviour on orgService.Create()?
body: <p>Microsoft Dynamics CRM 2015.</p>
  <p>I test Asp.Net Core controller's action. When I create new <code>Lead</code> record some plugin generates new Guid for <code>lead.new_master_id</code> field (it's type is <code>string</code>). Therefore after creating I retrive the record to get it's generated <code>new_master_id</code> value. How can I emulate this plugin behaviour through <a href="https://dynamicsvalue.com/home" rel="nofollow noreferrer">Fake Xrm Easy</a>?</p>
  <pre><code>var fakedContext = new XrmFakedContext();
  fakedContext.ProxyTypesAssembly = typeof(Lead).Assembly;
  var entities = new Entity[]
  {
    // is empty array
  };
  
  fakedContext.Initialize(entities);
  var orgService = fakedContext.GetOrganizationService();
  
  var lead = new Lead { FirstName = &quot;James&quot;, LastName = &quot;Bond&quot; };
  var leadId = orgService.Create(lead);
  
  var masterId = orgService.Retrieve(Lead.EntityLogicalName, leadId, 
      new Microsoft.Xrm.Sdk.Query.ColumnSet(Lead.Fields.new_master_id))
      .ToEntity&lt;Lead&gt;().new_master_id;
  </code></pre>