public static Object GetEDFieldValue(this Object instance, MemberInfo mi, AbstractBindMember bm) { FkMemberInfo fk = mi as FkMemberInfo; if (fk == null) return ValidDBValue(bm.GetValue(instance, mi)); Object entity = bm.GetValue(instance, instance.GetType().GetMember(fk.ToBindInfo.Name)[0]); return bm.GetValue(entity, fk.PkInfo); }
public static Object BindEDFieldValue(this Object instance, MemberInfo mi, AbstractBindMember bm, Object dbvalue) { FkMemberInfo fk = mi as FkMemberInfo; if (fk == null) return bm.bind(instance, mi, dbvalue); Object entity = bm.GetValue(instance, instance.GetType().GetMember(fk.ToBindInfo.Name)[0]); return bm.bind(entity, fk.PkInfo, dbvalue); }