In my application I have 2 entities that are defined as:
public class A {
public B ClassB { get; set; }
// Bunch of code
}
public class B {
// Bunch of code
}
When I create a new instance of class A, assign it a new instance of B and insert A into the DataContext, the instance of B is also inserted into the DataContext. My problem appears when I want the DataContext not no insert that entity into the database. I have not found any way to eliminate that entity from the DataContext so that it is not inserted. I've tried:
DataContext.A.DeleteOnSubmit(InstanceOfB);
to no avail.
Does anyone has an idea what I'm doing wrong??
Thanks
The