public IHttpActionResult PutCertificateSet(int id, CertificateSet сertificateSet)
        {
            if (id != сertificateSet.Id)
            {
                return BadRequest();
            }
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.CertificateSets.Attach(сertificateSet);
            var entry = db.Entry(сertificateSet);
            var orig = entry.OriginalValues;

            if (orig["MaskString"] != сertificateSet.MaskString)
                return BadRequest("Cant change mask string");

            if (int.Parse(orig["CompanyId"].ToString()) != сertificateSet.CompanyId)
                return BadRequest("Cant change company");
            entry.State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CertificateSetExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
        public IHttpActionResult PostCertificateSet(CertificateSet certificateset)
        {
            if (certificateset == null)
                return BadRequest("CertificateSet is null");
            if (!ModelState.IsValid)
                return BadRequest(ModelState);

            db.CertificateSets.Add(certificateset);
            db.SaveChanges();
            return CreatedAtRoute("certificateAdd", new { id = certificateset.Id }, certificateset);
        }