private static string MetricsString(MetricsEntity entity, OperationContext opContext) { var entityProperties = entity.WriteEntity(opContext); var entityString = string.Format("Time: {0}, ", entity.Time) + string.Format("AccessType: {0}, ", entity.AccessType) + string.Format("TransactionType: {0}, ", entity.TransactionType) + string.Join(",", entityProperties.Select(e => new KeyValuePair <string, string>(e.Key.ToString(), e.Value.PropertyAsObject.ToString()))); return(entityString); }