public ActionResult Create()
        {
            // Workaround to get values for DropDownList
            SimpleCompanyEntities db = new SimpleCompanyEntities();

            ViewBag.DepartmentId = new SelectList(db.Departments, "Id", "Name");
            //

            return(View());
        }
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var client   = new HttpClient();
            var response = await client.GetAsync($"{baseUrl}/{id.Value}");

            if (response.IsSuccessStatusCode)
            {
                var user = JsonConvert.DeserializeObject <User>(await response.Content.ReadAsStringAsync());

                // Workaround to get values for DropDownList
                SimpleCompanyEntities db = new SimpleCompanyEntities();
                ViewBag.DepartmentId = new SelectList(db.Departments, "Id", "Name", user.DepartmentId);
                //

                return(View(user));
            }
            return(new HttpNotFoundResult());
        }