public static PropertyAccessor Create(Type type) { var accessor = new PropertyAccessor(); foreach (var prop in type.GetProperties()) { accessor.Properies.Add(prop.Name, CreateGetMethod(prop, type)); } return accessor; }
private string GetDocumentId(object doc, out PropertyAccessor accessor) { Type type = doc.GetType(); accessor = propertyAccessorCache.GetOrAdd(type, PropertyAccessor.Create); return accessor.GetValue(Constants.DocumentIdFieldName, doc) as string; }