private static string GetRelatedToOneEntityId(JToken document, PropertyInfo toOneProp)
        {
            string jsonFieldName   = EntityDefinitionBuilder.GetJsonFieldName(toOneProp);
            string relatedEntityId = document.Value <string>(jsonFieldName);

            return(relatedEntityId);
        }
Example #2
0
        internal static JArray GetJArray(PropertyInfo prop, JToken doc)
        {
            string jsonFieldName = EntityDefinitionBuilder.GetJsonFieldName(prop);
            var    jArr          = (JArray)doc[jsonFieldName];

            return(jArr);
        }
Example #3
0
        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);
        }