I also had that problem a while ago. I added a few lines to my code that made it disappear.
Linq2SQL is a bit magical and sometimes things (don't) work for no obvious reason. Just to be perfectly sure you might want to implement the official One-To-Many solution provided by Microsoft:
http://msdn.microsoft.com/en-us/library/vstudio/bb386950(v=vs.100).aspx
Also I would make the following adjustments:
[Table]
class Number
{
[Column(IsPrimaryKey = true, IsDbGenerated = true)]
public int NumberID { get; set; }
[Column]
public int _personID { get; set; }
[Column]
public int PhoneNumber { get; set; }
private EntityRef<Person> _person;
[Association(Storage = "_person", ThisKey = "_personID", OtherKey = "PersonID", IsForeignKey = true)]
public Person Person
{
get { return this._person.Entity; }
set {
this._person.Entity = value;
if (value != null)
{
this._personID = value.PersonID;
}
}
}
}
And I'd add this to the constructor:
public Person()
{
this._numbers = new EntitySet<Number>(
delegate (Number entity)
{
entity.Person = this;
},
delegate (Number entity)
{
entity.Person = null;
});
}
As a test I would not try to load the entire object. First just check if all numbers have made it to the database:
var numbers = db.Numbers.ToList();
This is because L2S on Windows Phone has serious trouble reading deep object connections. One level is fine but deeper relationships are ignored. So if your Person class resides in another class that could be a problem as well.
Edit: You can add options to your DB context in order to force deep object loading:
_db = new DBContext("isostore:/mydb.sdf");
DataLoadOptions loadOptions = new DataLoadOptions();
loadOptions.LoadWith<Person>(p => p.Numbers);
_db.LoadOptions = loadOptions;