public Company Add(Company 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(Company company) { TypeOfProfile = "Company"; }
public void Delete(Company entity) { context.DeleteObject(entity); }
public Company Update(Company entity) { return entity; }
private void FixupCompany(Company previousValue) { if (previousValue != null && previousValue.Transaction.Contains(this)) { previousValue.Transaction.Remove(this); } if (Company != null) { if (!Company.Transaction.Contains(this)) { Company.Transaction.Add(this); } if (Company_id != Company.Id) { Company_id = Company.Id; } } }