public IHttpActionResult PostUser(CourierAccountViewModel courier)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            User user = new User
            {
                CompanyId = courier.CompanyId,
                UserName  = courier.Name,
                Phone     = courier.Phone,
                Address   = courier.Address,
                Email     = courier.Email,
            };
            IdentityResult result = CreateAcount(user, courier.Password, "courier");

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (UserExists(user.Id))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }
            courier.Id = user.Id;
            return(CreatedAtRoute("DefaultApi", new { id = user.Id }, courier));
        }
        public IHttpActionResult PutUser(string email, string password, CourierAccountViewModel courier)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            User user = UserManager.FindByEmail(email);

            if (user != null)
            {
                user = UserManager.Find(user.UserName, password);
            }
            user.UserName        = courier.Name;
            user.Email           = courier.Email;
            user.Phone           = courier.Phone;
            user.Address         = courier.Address;
            db.Entry(user).State = EntityState.Modified;
            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!UserExists(user.Id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }
            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult GetUser(string email, string password)
        {
            User user = UserManager.FindByEmail(email);

            if (user != null)
            {
                user = UserManager.Find(user.UserName, password);
            }
            if (user == null)
            {
                return(NotFound());
            }
            CourierAccountViewModel courier = new CourierAccountViewModel()
            {
                Id        = user.Id,
                CompanyId = user.CompanyId,
                Name      = user.UserName,
                Email     = user.Email,
                Phone     = user.Phone,
                Address   = user.Address
            };

            return(Ok(courier));
        }