public async Task SaveAsync(Qualification entity)
        {
            try
            {
                if (entity == null)
                {
                    return;
                }

                using (var timeLineContext = _contextFactory.GetTimeLineContext())
                {
                    var entityModel = await timeLineContext
                                      .Qualifications
                                      .FirstOrDefaultAsync(item => item.Id.Equals(entity.Id));

                    if (entityModel == null)
                    {
                        entityModel = new DA.Qualification();
                        MapForUpdateentity(entity, entityModel);
                        await timeLineContext.Qualifications.AddAsync(entityModel);
                    }
                    else
                    {
                        MapForUpdateentity(entity, entityModel);
                    }


                    timeLineContext.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 // DELETE api/qualifications/4
 public HttpResponseMessage Delete(int id)
 {
     var qualification = new Qualification { QualificationId = id };
       _db.Qualifications.Attach(qualification);
       var status = _db.Qualifications.Remove(qualification);
       _db.SaveChanges();
       if (status != null) return new HttpResponseMessage(HttpStatusCode.OK);
       throw new HttpResponseException(HttpStatusCode.NotFound);
 }
 //POST api/qualifications
 public HttpResponseMessage Post([FromBody] QualificationModel values)
 {
     var empId=_db.Employees.Where(e=>e.FirstName==values.EmployeeFirstName).Where(e=>e.LastName==values.EmployeeLastName).FirstOrDefault().EmployeeId;
      var serviceId=_db.Services.FirstOrDefault(s=>s.ServiceName==values.ServiceName).ServiceId;
      var qualification = new Qualification
      {
     EmployeeId = empId,
     ServiceId = serviceId
      };
      var q = _db.Qualifications.Add(qualification);
      _db.SaveChanges();
      _db.SaveChanges();
      if (q != null)
      {
     var msg = new HttpResponseMessage(HttpStatusCode.Created);
     msg.Headers.Location = new Uri(Request.RequestUri + "/" + qualification.QualificationId.ToString());
     return msg;
      }
      else
      {
     var msg = new HttpResponseMessage(HttpStatusCode.BadRequest);
     return msg;
      }
 }
 private void MapForUpdateentity(Qualification entity, DA.Qualification daEntity)
 {
     daEntity.Id = entity.Id;
 }