After update I have lots of my unit tests failed.
The problem is that Entity is not persisted and/or initialized after it was created.
For example property EntitySet<t> is null after calling new MyEntity() in 5.0.1 and not null in beta1. The same with Id property. It is set automatically in beta1 and not set in 5.0.1.
It looks like a change in defaults. Where should I look?
UPDATE: some code
[HierarchyRoot]
[KeyGenerator(KeyGeneratorKind.Default, Name = "TaskAssignmentKeyGenerator")]
public class TaskAssignment : Entity
{
public TaskAssignment(Session session) : base(session) {}
[Key]
[Field]
public int Id { get; set; }
[Field]
public Task Task { get; set; }
}
[HierarchyRoot(InheritanceSchema = InheritanceSchema.ClassTable)]
[KeyGenerator(KeyGeneratorKind.Default, Name = "TaskKeyGenerator")]
public class Task : Entity
{
[Key]
[Field]
public int Id { get; set; }
[Field]
[Association(PairTo = "Task")]
public EntitySet<TaskAssignment> TaskAssignments { get; set; }
}
[Test]
public void Foo()
{
var task = new Task(Session.Current);
var ta = new TaskAssignment(Session.Current) {Task = task};
Session.Current.SaveChanges(); // optional, was added just to make sure
Assert.That(task.TaskAssignments != null); // fails after update to 5.0.1 from beta1
}
asked
Sep 04 '14 at 08:23
Pavel Kudinov
7●3●3●5
Hi Pavel.
Could you give me some example?
Thanks for example. This is really strange situation because on our side it works well. We are trying to find out why.
Write me email on alexey.kulakov@dataobjects.net and we will discuss this issue.