Hi
I have an OrderStatus object that is loaded via nhibernate. I am trying to do some comparisons on it based on its type, but instead of seeing the type i am looking for, I am getting CProxyTypeOrders_CoreOrderStatusCore_NHibernate_ProxyINHibernateProxy1.
Is there a way to determine the type?
Here is the output from GetType()
Code:
? status.GetType()
{Name = "CProxyTypeOrders_CoreOrderStatusCore_NHibernate_ProxyINHibernateProxy1" FullName = "CProxyTypeOrders_CoreOrderStatusCore_NHibernate_ProxyINHibernateProxy1"}
[System.RuntimeType]: {Name = "CProxyTypeOrders_CoreOrderStatusCore_NHibernate_ProxyINHibernateProxy1" FullName = "CProxyTypeOrders_CoreOrderStatusCore_NHibernate_ProxyINHibernateProxy1"}
base {System.Reflection.MemberInfo}: {Name = "CProxyTypeOrders_CoreOrderStatusCore_NHibernate_ProxyINHibernateProxy1" FullName = "CProxyTypeOrders_CoreOrderStatusCore_NHibernate_ProxyINHibernateProxy1"}
Assembly: {DynamicAssemblyProxyGen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null}
AssemblyQualifiedName: "CProxyTypeOrders_CoreOrderStatusCore_NHibernate_ProxyINHibernateProxy1, DynamicAssemblyProxyGen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
Attributes: Public | Serializable
BaseType: {Name = "OrderStatus" FullName = "Orders.Core.OrderStatus"}
ContainsGenericParameters: false
DeclaringMethod: 'status.GetType().DeclaringMethod' threw an exception of type 'System.InvalidOperationException'
DeclaringType: null
FullName: "CProxyTypeOrders_CoreOrderStatusCore_NHibernate_ProxyINHibernateProxy1"
GenericParameterAttributes: 'status.GetType().GenericParameterAttributes' threw an exception of type 'System.InvalidOperationException'
GenericParameterPosition: 'status.GetType().GenericParameterPosition' threw an exception of type 'System.InvalidOperationException'
GUID: {efb52c8d-8bb8-32ce-bb8e-5f0ecb58f2ac}
HasElementType: false
IsAbstract: false
IsAnsiClass: true
IsArray: false
IsAutoClass: false
IsAutoLayout: true
IsByRef: false
IsClass: true
IsCOMObject: false
IsContextful: false
IsEnum: false
IsExplicitLayout: false
IsGenericParameter: false
IsGenericType: false
IsGenericTypeDefinition: false
IsImport: false
IsInterface: false
IsLayoutSequential: false
IsMarshalByRef: false
IsNested: false
IsNestedAssembly: false
IsNestedFamANDAssem: false
IsNestedFamily: false
IsNestedFamORAssem: false
IsNestedPrivate: false
IsNestedPublic: false
IsNotPublic: false
IsPointer: false
IsPrimitive: false
IsPublic: true
IsSealed: false
IsSerializable: true
IsSpecialName: false
IsUnicodeClass: false
IsValueType: false
IsVisible: true
MemberType: TypeInfo
Module: {DynamicAssemblyProxyGen}
Namespace: null
ReflectedType: null
StructLayoutAttribute: {System.Runtime.InteropServices.StructLayoutAttribute}
TypeHandle: {System.RuntimeTypeHandle}
TypeInitializer: null
UnderlyingSystemType: {Name = "CProxyTypeOrders_CoreOrderStatusCore_NHibernate_ProxyINHibernateProxy1" FullName = "CProxyTypeOrders_CoreOrderStatusCore_NHibernate_ProxyINHibernateProxy1"}
Code:
? status
{Orders.Core.OrderStatusPending}
And here is the output when i do a quick ? status
[CProxyTypeOrders_CoreOrderStatusCore_NHibernate_ProxyINHibernateProxy1]: {Orders.Core.OrderStatusPending}
_ISSStatusId: ""
_OrderStatusDescription: ""
_OrderStatusId: 0
ISSStatusId: null
OrderStatusDescription: "Pending "
OrderStatusId: 1
The IDE can "see" it, so its possible, but can anyone tell me how to get "Orders.Core.OrderStatusPending" through code?
Thanks for any help
Joe