Here I'm checking for Xrecords and writing their contents to List. AppRecordKey is string constant contains name of Xrecord that I need
List<string> groups = new List<string>();
Entity entity = transaction.GetObject(id, OpenMode.ForRead) as Entity;
if (entity != null)
{
if (entity.ExtensionDictionary != ObjectId.Null)
{
using (DBDictionary dict = transaction.GetObject(
entity.ExtensionDictionary, OpenMode.ForRead) as DBDictionary)
{
if (dict.Contains(AppRecordKey))
{
Xrecord xrecord = transaction.GetObject(dict.GetAt(AppRecordKey), OpenMode.ForRead) as Xrecord;
ResultBuffer buffer = xrecord.Data;
foreach (TypedValue recordValue in buffer)
{
groups.Add(recordValue.Value.ToString());
}
}
}
}
}