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;
        }
示例#3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ContractorContacts EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToContractorContacts(ContractorContact contractorContact)
 {
     base.AddObject("ContractorContacts", contractorContact);
 }
示例#4
0
 /// <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;
 }