Hello. I'm having a problem: I have User:
[Class(Table = "Users", Name = "User")]
public class User
{
[Id(0, Column = "UserId", Type = "Guid", Name = "Id")]
[Generator(1, Class = "assigned")]
public Guid Id { get; set; }
[Property(Name = "Password", Column = "Password", Type = "String")]
public string Password { get; set; }
[Property(Name = "Email", Column = "Email", Type = "String")]
public string Email { get; set; }
}
And a ditributor:
[JoinedSubclass(ExtendsType = typeof(User), Table = "Distributors")]
public class Distributor : User
{
[Id(0, Column = "DistributorId", Type = "Guid", Name = "Identifier")]
[Generator(1, Class = "assigned")]
protected Guid Identifier { get; set; }
[Property(Name = "Company", Column = "Company", Type = "String")]
public String Company { get; set; }
}
Now I need to promote user to distributor. But I need to save his id (other parts of the system are using it). I'm getting user and creating new distributor. But when I'm trying to save distributor I'm getting this error:
a different object with the same identifier value was already associated with the session: ec6f6a9f-a236-4385-835c-7f408a5f594d, of entity: MLMCore.Entities.Distributor
I have tryed all the methods (save, SaveOrUpdade, SaveOrUpdateCopy, Update). But it doesn't works. Any ideas how to fix it?