tags:

views:

22

answers:

1

It seems impossible to me to have a natural-id in a component.

public class User
{
    private IAccount account;
    public User(string name, string password){
        account = new Account()
        {
                UserName = name,
                Password = password
        };
    }
}

public class Account : IAccount
{
    public string UserName { get; set; }
    public string Password { get; set; }
}

I want the natural-id to be User.Account.UserName. I tried proxying it, but

Could not find field 'account.UserName' in class 'Customer'

which tells me this is not possible. But I may be wrong...

A: 

It's not possible.

Just look at the xsd: only a class can contain a natural-id.

Diego Mijelshon
sad but probably true
Jan Limpens