示例#1
0
 public static void Deserialize <T, TIntermediate, TPOCO>(this TIntermediate source, SerializationInfo info)
     where T : IEntity <TIntermediate>
     where TIntermediate : IntermediateEntity <T>
     where TPOCO : IPOCO <T>, new()
 {
     foreach (PropertyInfo prop in typeof(TPOCO).GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly)
              .Where(p => !typeof(IPOCOContainer).IsAssignableFrom(p.PropertyType)))
     {
         var fieldOnIntermediate = TypesUtil.GetIntermediateContainer(typeof(TIntermediate), prop.Name).GetValue(source) as IEntityField;
         fieldOnIntermediate.MaterializeSet(info.GetValue(prop.Name, prop.PropertyType));
     }
 }