private Soul _NewSoul(object soul, Type soul_type) { MemberMap map = _Protocol.GetMemberMap(); int interfaceId = map.GetInterface(soul_type); Soul newSoul = new Soul(_IdLandlord.Rent(), interfaceId, soul_type, soul); // property PropertyInfo[] propertys = soul_type.GetProperties(BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.Public); for (int i = 0; i < propertys.Length; ++i) { PropertyInfo property = propertys[i]; int id = map.GetProperty(property); if (property.PropertyType.GetInterfaces().Any(t => t == typeof(IDirtyable))) { object propertyValue = property.GetValue(soul); IDirtyable dirtyable = propertyValue as IDirtyable; PropertyUpdater pu = new PropertyUpdater(dirtyable, id); newSoul.AddPropertyUpdater(pu); } } _Souls.Add(newSoul); return(newSoul); }