CreateEntityInfoFromJson() protected method

protected CreateEntityInfoFromJson ( dynamic jo, Type entityType ) : EntityInfo
jo dynamic
entityType System.Type
return EntityInfo
示例#1
0
        public SaveWorkState(ContextProvider contextProvider, JArray entitiesArray)
        {
            ContextProvider = contextProvider;
            var jObjects = entitiesArray.Select(jt => (dynamic)jt).ToList();
            var groups   = jObjects.GroupBy(jo => (String)jo.entityAspect.entityTypeName).ToList();

            EntityInfoGroups = groups.Select(g => {
                var entityType  = ContextProvider.LookupEntityType(g.Key);
                var entityInfos = g.Select(jo => ContextProvider.CreateEntityInfoFromJson(jo, entityType)).Cast <EntityInfo>().ToList();
                return(new EntityGroup()
                {
                    EntityType = entityType, EntityInfos = entityInfos
                });
            }).ToList();
        }
    public SaveWorkState(ContextProvider contextProvider, JArray entitiesArray) {
      ContextProvider = contextProvider;
      var jObjects = entitiesArray.Select(jt => (dynamic)jt).ToList();
      var groups = jObjects.GroupBy(jo => (String)jo.entityAspect.entityTypeName).ToList();

      EntityInfoGroups = groups.Select(g => {
        var entityType = ContextProvider.LookupEntityType(g.Key);
        var entityInfos = g.Select(jo => ContextProvider.CreateEntityInfoFromJson(jo, entityType)).Cast<EntityInfo>().ToList();
        return new EntityGroup() { EntityType = entityType, EntityInfos = entityInfos };
      }).ToList();
    }