詳細情報:
編集:より良いサンプル:
私は UserAccount と呼ばれるライブラリにクラスを持っています。次に、ライブラリに次のような機能があります。
class UserAccountService
{
public static UserAccount CreateUserAccount(String username, String password, String email)
{
UserAccount account = new UserAccount();
account.Username = username;
account.HashedPass = //Some crypting stuff with password
account.Email = email;
UserAccountRepository db = new UserAccountRepository();
db.UserAccounts.Add(account);
return account;
}
}
これは独立したライブラリであるため、UserAccount には使用したいプロパティがすべて含まれているわけではありません。
class ExtendedUserAccount : UserAccount
{
// define some additional methods and propertys
public Contact Contacts{get;set}// this property is only used in one application where i use the Library....
}
それから私はこれをしたい:
ExtendedUserAccount newAccount = UserAccountService.CreateUserAccount(new UserAccount);
しかし、これはうまくいきません。私は今では正しくありませんが、似たようなものが必要です...
誰かがアイデアを持っていますか??