public ContractorContact Update(ContractorContact e) { DB.ContractorContacts.Attach(e); DB.ObjectStateManager.ChangeObjectState(e, System.Data.EntityState.Modified); Save(); return e; }
public ContractorContact Add(int contractorID) { var contractorRepo = new ContractorRepository() { DB = DB }; var contractor = contractorRepo.Get(contractorID); var contractorContact = new ContractorContact(); contractor.ContractorContacts.Add(contractorContact); Save(); return contractorContact; }
/// <summary> /// Deprecated Method for adding a new object to the ContractorContacts EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToContractorContacts(ContractorContact contractorContact) { base.AddObject("ContractorContacts", contractorContact); }
/// <summary> /// Create a new ContractorContact object. /// </summary> /// <param name="id">Initial value of the ID property.</param> public static ContractorContact CreateContractorContact(global::System.Int32 id) { ContractorContact contractorContact = new ContractorContact(); contractorContact.ID = id; return contractorContact; }