参照しているアセンブリの一部であるクラスがあります。そのタイプのオブジェクトを、参照しているクラスを実装する独自のクラスに変換したい
私の参照が持っているとしましょう
public class customer
{
public string name {get;set}
public string address{get;set}
}
そして私は作成しました
public class mycustomer : customer
{
public string name {get; set}
public string address{get;set}
public string email {get;set}
}
リフレクションの使用について読んだことがありますが、実際に自分で書くには十分ではありません。
PS。命名規則のセマンティクスを止めてください - これはその場での大まかな理論的な例です (ここでは命名規則を気にせず、実際のコードでのみ) 事前に感謝します
編集:とにかくこれを行うことができないことがわかりました。シリアライズ可能属性を持たないオブジェクトをシリアライズする必要があり、そのクラスをミラーリングしてシリアライズ可能にできると思っていましたが、このクラス内のプロパティの一部にシリアライズ可能属性がないことに気付きました。
とにかくありがとう - 質問に対する最良の回答を回答/Alexとしてマークします