public HttpResponseMessage PostAuthor(AuthorViewModel authorViewModel)
        {
            if (ModelState.IsValid)
            {
                var author = _repositoryManager.Create(Mapper.Map<AuthorViewModel, Author>(authorViewModel), authorViewModel.Description);
                var response = Request.CreateResponse(HttpStatusCode.Created, author);
                response.Headers.Location = new Uri(Url.Link("~/api/Author/", new { id = author.UserId }));
                return response;
            }

            return Request.CreateResponse(HttpStatusCode.BadRequest);
        }
        public ActionResult Edit(int id, AuthorViewModel viewModel)
        {
            try
            {
                _authorController.PutAuthor(id, viewModel);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
        public HttpResponseMessage PutAuthor(int id, AuthorViewModel authorViewModel)
        {
            if (ModelState.IsValid && id == authorViewModel.UserId)
            {
                try
                {
                    var author = new Author();
                    Mapper.Map(authorViewModel, author);
                    _repository.Update(id, author);
                }
                catch (DbUpdateConcurrencyException)
                {
                    return Request.CreateResponse(HttpStatusCode.NotFound);
                }

                return Request.CreateResponse(HttpStatusCode.OK, authorViewModel);
            }
            else
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }
        }
 public ActionResult Create(AuthorViewModel viewModel)
 {
     _authorController.PostAuthor(viewModel);
     return View();
 }