Quick Viso Data Model Diagram

One of the samples in the SDK that is often overlooked is a Visio data model generator. You can find it in the SDK samples $SDK/SampleCode/CS/Metadata/Diagram and you can find the write up here - https://msdn.microsoft.com/en-us/library/jj602918.aspx

If you just run it as is, the diagram produced isn't of much value because it has so many entities in it. If you simply look at the loop where it is deciding what entities to include and add your filters you can really create a more usable diagram. Notice below I've added a filter of only entities that start with "dave_".

 foreach (EntityMetadata entity in response.EntityMetadata)
 {
     // Only draw an entity if it does not exist in the excluded entity table.
     if (!_excludedEntityTable.ContainsKey(entity.LogicalName.GetHashCode()))
     {
         if (entity.LogicalName.StartsWith("dave_"))
             entities.Add(entity.LogicalName);
     }
     else
     {
         Console.WriteLine("Excluding entity: {0}", entity.LogicalName);
     }
 }
comments powered by Disqus