public void UpdateStateOfElection(StateOfElection stateOfElection)
 {
     //using (var context = new Context())
     {
         context.StateOfElection.Update(stateOfElection);
         context.SaveChanges();
     }
 }
 public void InitializeStateOfElection(StateOfElection stateOfElection)
 {
     //using (var context = new Context())
     {
         context.StateOfElection.Add(stateOfElection);
         context.SaveChanges();
     }
 }
        public void AddNewStateOfElection()
        {
            var electionState = new StateOfElection();

            var         stringJson = JsonConvert.SerializeObject(electionState);
            HttpContent content    = new StringContent(stringJson, Encoding.UTF8, "application/json");

            var response = _client.PostAsync($"Election", content).Result;
        }
 public void Post([FromBody] StateOfElection stateOfElection)
 {
     _stateOfElection.InitializeStateOfElection(stateOfElection);
 }
 public void Put([FromBody] StateOfElection stateOfElection)
 {
     _stateOfElection.UpdateStateOfElection(stateOfElection);
 }