private static string GetRelatedToOneEntityId(JToken document, PropertyInfo toOneProp) { string jsonFieldName = EntityDefinitionBuilder.GetJsonFieldName(toOneProp); string relatedEntityId = document.Value <string>(jsonFieldName); return(relatedEntityId); }
internal static JArray GetJArray(PropertyInfo prop, JToken doc) { string jsonFieldName = EntityDefinitionBuilder.GetJsonFieldName(prop); var jArr = (JArray)doc[jsonFieldName]; return(jArr); }
public void MapDocTypeToEntity(string docType, Type entityType) { docTypeToEntityType.Add(docType, entityType); entityTypeToDocType.Add(entityType, docType); var entityDefBuilder = new EntityDefinitionBuilder(entityType); EntityDefinition entityDef = entityDefBuilder.Build(); entityDefinitions.Add(entityType, entityDef); }