How do you handle the case when the subject must create other objects in one of his methods? My problem is that since each individual object does not have an ObjectContext access object, that is, using the AddToBlahs () methods, it cannot do this.
For example, the presence of a site model that has the UpdateLinks () method, which should create Link objects belonging to this site. The UpdateLinks () method does not have an ObjectContext. What do you do? You pass one of them, for example:
public void UpdateLinks(ProjectEntities db) {
foreach (var link in FetchLinks()) {
db.AddToLinks(link);
}
}
or are you using a different template?
source
share