public Profile Add(Profile entity) { if (entity.Id > 0) return entity; context.Profile.AddObject(entity); try { context.SaveChanges(); } catch (OptimisticConcurrencyException e) { //An optimistic concurrency violation has occurred in the data source. throw new ConcurrencyException(e.Message); } return entity; }
public void Visit(Profile profile) { profile.Accept(this); }
public Profile Update(Profile entity) { return entity; }
public void Delete(Profile entity) { context.DeleteObject(entity); }
private void FixupProfile(Profile previousValue) { if (previousValue != null && previousValue.Withdraw.Contains(this)) { previousValue.Withdraw.Remove(this); } if (Profile != null) { if (!Profile.Withdraw.Contains(this)) { Profile.Withdraw.Add(this); } if (Profile_id != Profile.Id) { Profile_id = Profile.Id; } } }