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; }
/// <summary> /// Deprecated Method for adding a new object to the ClientContacts EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToClientContacts(ClientContact clientContact) { base.AddObject("ClientContacts", clientContact); }
/// <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; }