public async Task<IHttpActionResult> PutCustomer(int id, Customer customer)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != customer.CustomerId)
            {
                return BadRequest();
            }

            db.Entry(customer).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CustomerExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
        public async Task<IHttpActionResult> PostCustomer(Customer customer)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            //db.Customers.Add(customer);
            //await db.SaveChangesAsync();
            //var bookIdParameter = new SqlParameter();
            //bookIdParameter.ParameterName = "@customer_id";
            //bookIdParameter.Direction = ParameterDirection.Output;
            //bookIdParameter.SqlDbType = SqlDbType.Int;
            //var customerId = db.Database.ExecuteSqlCommand("dbp_insert_customer_data @pn_Name, @pn_phone, @customer_id OUT",
            //                                          new SqlParameter("@pn_Name", customer.Name),
            //                                          new SqlParameter("@pn_phone", customer.Phone),
            //                                          bookIdParameter);

            //customer.CustomerId = (int)bookIdParameter.Value;
            var connectionString = ConfigurationManager.ConnectionStrings["TRAContext"].ConnectionString;
            SqlDataReader reader = null;
            var id = 0;
            using (var connection = new SqlConnection(connectionString))
            {
                var cmd = new SqlCommand("irfank.dbp_insert_customer_data", connection);
                connection.Open();
                try
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add(new SqlParameter("@pn_Name", customer.Name));
                    cmd.Parameters.Add(new SqlParameter("@pn_phone", customer.Phone));
                    reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        id = Convert.ToInt32(reader["customer_id"]);
                    }
                }
                catch (Exception)
                {
                    throw;
                }
                finally
                {
                    if (reader != null)
                    {
                        reader.Close();
                    }
                }

            }

            customer.CustomerId = id;
            return CreatedAtRoute("DefaultApi", new { id = customer.CustomerId }, customer);
        }