protected internal EntityInfo CreateEntityInfoFromJson(dynamic jo, Type entityType) {
var entityInfo = CreateEntityInfo();
entityInfo.Entity = JsonSerializer.Deserialize(new JTokenReader(jo), entityType);
entityInfo.EntityState = (EntityState)Enum.Parse(typeof(EntityState), (String)jo.entityAspect.entityState);
entityInfo.ContextProvider = this;
entityInfo.UnmappedValuesMap = JsonToDictionary(jo.__unmapped);
entityInfo.OriginalValuesMap = JsonToDictionary(jo.entityAspect.originalValuesMap);
var autoGeneratedKey = jo.entityAspect.autoGeneratedKey;
if (entityInfo.EntityState == EntityState.Added && autoGeneratedKey != null) {
entityInfo.AutoGeneratedKey = new AutoGeneratedKey(entityInfo.Entity, autoGeneratedKey);
}
return entityInfo;
}