public Account Add(Account entity) { if (entity.Id > 0) return entity; context.Account.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 Account Update(Account entity) { return entity; }
public void Delete(Account entity) { context.DeleteObject(entity); }
private void FixupAccount(Account previousValue) { if (previousValue != null && previousValue.Profile.Contains(this)) { previousValue.Profile.Remove(this); } if (Account != null) { if (!Account.Profile.Contains(this)) { Account.Profile.Add(this); } if (Account_id != Account.Id) { Account_id = Account.Id; } } }