@@ -152,7 +152,7 @@ protected void Serialize(object value, Stream writeStream, JsonWriter writer, Js
152152
153153 // Do the Id now...
154154 writer . WritePropertyName ( "id" ) ;
155- var idProp = GetIdProperty ( value . GetType ( ) ) ;
155+ var idProp = ModelManager . Instance . GetIdProperty ( value . GetType ( ) ) ;
156156 writer . WriteValue ( GetValueForIdProperty ( idProp , value ) ) ;
157157
158158 PropertyInfo [ ] props = value . GetType ( ) . GetProperties ( ) ;
@@ -819,15 +819,17 @@ protected object GetById(Type type, string id)
819819 {
820820 // Only good for creating dummy relationship objects...
821821 object retval = Activator . CreateInstance ( type ) ;
822- PropertyInfo idprop = GetIdProperty ( type ) ;
822+ PropertyInfo idprop = ModelManager . Instance . GetIdProperty ( type ) ;
823823 idprop . SetValue ( retval , System . Convert . ChangeType ( id , idprop . PropertyType ) ) ;
824824 return retval ;
825825 }
826826
827+ /*
827828 protected PropertyInfo GetIdProperty(Type type)
828829 {
829830 return type.GetProperty("Id");
830831 }
832+ */
831833
832834 protected string GetValueForIdProperty ( PropertyInfo idprop , object obj )
833835 {
@@ -846,7 +848,7 @@ protected string GetValueForIdProperty(PropertyInfo idprop, object obj)
846848 protected string GetIdFor ( object obj )
847849 {
848850 Type type = obj . GetType ( ) ;
849- PropertyInfo idprop = GetIdProperty ( type ) ;
851+ PropertyInfo idprop = ModelManager . Instance . GetIdProperty ( type ) ;
850852 return GetValueForIdProperty ( idprop , obj ) ;
851853 }
852854
0 commit comments