Up casting - c#

前端 未结 6 1044
星月不相逢
星月不相逢 2021-01-17 15:57
public class a{
  public string x1 {get;set;}
  public string x2 {get;set;}
  public string x3 {get;set;}
}

public class b:a{
}

Obviously v

6条回答
  •  长发绾君心
    2021-01-17 16:37

    This is something that has always bothered me as well. I worked out a solution to it by creating my own Up-Casting utility.

    You can read my article here on how to do it -- it's pretty simple actually.

    http://sympletech.com/c-up-casting-utility/

提交回复
热议问题