1

We have a project which has two modules which uses same UDTs. We have generated UDT's shown in example code. When our project calls B's SP which should return UDT from B.DbObjects namespace, the returned type is A.DbObjects namespace. This occurs because Oracle Data Access gets type name from OracleCustomTypeMappingAttribute and creates instance with that value. Since the namespaces are different, we cannot bind data to our return type. Is there a solution for this?

Code:

Module A - Output A.dll

namespace A.DbObjects
{
    [OracleCustomTypeMapping("SCHEMA.UDTNAME")]
    public partial class UDTNAME : OracleCustomType
    {
        [OracleObjectMappingAttribute("X")]
        public string X { get; set; }
        [OracleObjectMappingAttribute("Y")]
        public decimal Y { get; set; }
        [OracleObjectMappingAttribute("Z")]
        public decimal Z { get; set; }
    }
}

Module B - Output B.dll

namespace B.DbObjects
{
    [OracleCustomTypeMapping("SCHEMA.UDTNAME")]
    public partial class UDTNAME : OracleCustomType
    {
        [OracleObjectMappingAttribute("X")]
        public string X { get; set; }
        [OracleObjectMappingAttribute("Y")]
        public decimal Y { get; set; }
        [OracleObjectMappingAttribute("Z")]
        public decimal Z { get; set; }
    }
}
0

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.