コード例 #1
0
        private JNode BuildOriginalValuesMapNode(StructuralAspect aspect, NamingConvention nc)
        {
            var stType = aspect.StructuralType;
            var ovMap  = aspect.OriginalValuesMap.ToDictionary(
                kvp => stType.GetProperty(kvp.Key).NameOnServer,
                kvp => kvp.Value);
            var cps = stType.ComplexProperties;

            cps.ForEach(cp => {
                var co         = aspect.GetValue(cp.Name);
                var serverName = cp.NameOnServer;
                if (cp.IsScalar)
                {
                    var ovmNode       = BuildOriginalValuesMapNode(((IComplexObject)co).ComplexAspect, nc);
                    ovMap[serverName] = ovmNode;
                }
                else
                {
                    var ovmNodes      = ((IEnumerable)co).Cast <IComplexObject>().Select(co2 => BuildOriginalValuesMapNode(co2.ComplexAspect, nc));
                    ovMap[serverName] = JNode.ToJArray(ovmNodes);
                }
            });
            var result = JNode.BuildMapNode(ovMap);

            return(result);
        }
コード例 #2
0
        private void DeserializeFrom(JNode jNode)
        {
            MetadataVersion = jNode.Get <String>("metadataVersion");
            // Name
            NamingConvention = NamingConvention.FromName(jNode.Get <String>("namingConvention"));
            // localQueryComparisonOptions
            jNode.GetJNodeArray("dataServices").Select(jn => new DataService(jn)).ForEach(ds => {
                if (GetDataService(ds.ServiceName) == null)
                {
                    AddDataService(ds);
                }
            });
            jNode.GetJNodeArray("structuralTypes")
            .ForEach(UpdateStructuralTypeFromJNode);

            jNode.GetMap <String>("resourceEntityTypeMap").ForEach(kvp => {
                var et = GetEntityType(kvp.Value);
                SetResourceName(kvp.Key, et);
            });
        }
コード例 #3
0
 internal NamingConvention InternNamingConvention(NamingConvention nc)
 {
     // locking is handled internally
     return(_namingConventionCache.Intern(nc));
 }
コード例 #4
0
 private JNode BuildOriginalValuesMapNode(StructuralAspect aspect, NamingConvention nc) {
   var stType = aspect.StructuralType;
   var ovMap = aspect.OriginalValuesMap.ToDictionary(
     kvp => stType.GetProperty(kvp.Key).NameOnServer, 
     kvp => kvp.Value);      
   var cps = stType.ComplexProperties;        
   cps.ForEach(cp => {
     var co = aspect.GetValue(cp.Name);
     var serverName = cp.NameOnServer;
     if (cp.IsScalar) {
       var ovmNode = BuildOriginalValuesMapNode( ((IComplexObject) co).ComplexAspect, nc);
       ovMap[serverName] = ovmNode;
     } else {
       var ovmNodes = ((IEnumerable) co).Cast<IComplexObject>().Select(co2 => BuildOriginalValuesMapNode(co2.ComplexAspect, nc));
       ovMap[serverName] = JNode.ToJArray(ovmNodes);
     }
   });
   var result = JNode.BuildMapNode(ovMap);
   return result;
 }
コード例 #5
0
 internal NamingConvention InternNamingConvention(NamingConvention nc)
 {
     return(_namingConventionCache.Intern(nc));
 }