public ClientContact Update(ClientContact e)
 {
     DB.ClientContacts.Attach(e);
     DB.ObjectStateManager.ChangeObjectState(e, System.Data.EntityState.Modified);
     Save();
     return e;
 }
        public ClientContact Add(int clientID)
        {
            var ClientRepo = new ClientRepository() { DB = DB };
            var Client = ClientRepo.Get(clientID);

            var ClientContact = new ClientContact();
            Client.ClientContacts.Add(ClientContact);
            Save();
            return ClientContact;
        }
Example #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ClientContacts EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToClientContacts(ClientContact clientContact)
 {
     base.AddObject("ClientContacts", clientContact);
 }
Example #4
0
 /// <summary>
 /// Create a new ClientContact object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 public static ClientContact CreateClientContact(global::System.Int32 id)
 {
     ClientContact clientContact = new ClientContact();
     clientContact.ID = id;
     return clientContact;
 }