You can not overload methods by varying only the type of return. You can use different names:
Code:
static Aobj GetAObject (string iden);
static Bobj GetBObject (string iden);
Or you can create a class with casting operators:
Code:
AorBobj class
(String iden;
AorBobj (string iden) (this.iden = iden;)
static public AorBobj RetrieveByID (string iden)
(Return new AorBobj (iden);
)
public static explicit operator Aobj (AorBobj ab)
AObjectQuery (return (ab.iden);
)
public static explicit operator Bobj (AorBobj ab)
BObjectQuery (return (ab.iden);
)
)
Then you can call it like this:
Code:
var a = (Aobj) AorBobj.RetrieveByID (8);
var b = (Bobj) AorBobj.RetrieveByID (8);
Bookmarks