Exemplo n.º 1
0
        public IActionResult CreateAuthor(OriginalAuthorContract request)
        {
            var client = GetCodeListClient();
            var newId  = client.CreateOriginalAuthor(request);

            return(Json(newId));
        }
Exemplo n.º 2
0
 public IActionResult CreateAuthor([FromBody] OriginalAuthorContract request)
 {
     using (var client = GetRestClient())
     {
         var newId = client.CreateOriginalAuthor(request);
         return(Json(newId));
     }
 }
Exemplo n.º 3
0
 public IActionResult UpdateOriginalAuthor(int authorId, [FromBody] OriginalAuthorContract author)
 {
     try
     {
         m_personManager.UpdateOriginalAuthor(authorId, author);
         return(Ok());
     }
     catch (HttpErrorCodeException exception)
     {
         return(StatusCode((int)exception.StatusCode, exception.Message));
     }
 }
Exemplo n.º 4
0
        public void UpdateOriginalAuthor(int authorId, OriginalAuthorContract data)
        {
            try
            {
                m_client.Put <HttpStatusCode>($"author/{authorId}", data);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
Exemplo n.º 5
0
        public int CreateOriginalAuthor(OriginalAuthorContract author)
        {
            try
            {
                var newId = m_client.Post <int>("author", author);
                return(newId);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
Exemplo n.º 6
0
 public UpdateOriginalAuthorWork(PersonRepository personRepository, int authorId, OriginalAuthorContract data) : base(personRepository)
 {
     m_personRepository = personRepository;
     m_authorId         = authorId;
     m_data             = data;
 }
Exemplo n.º 7
0
        public int CreateOriginalAuthor(OriginalAuthorContract author)
        {
            var resultId = new CreateOriginalAuthorWork(m_personRepository, author).Execute();

            return(resultId);
        }
Exemplo n.º 8
0
        public void UpdateOriginalAuthor(int authorId, OriginalAuthorContract author)
        {
            var updateOriginalAuthorWork = new UpdateOriginalAuthorWork(m_personRepository, authorId, author);

            updateOriginalAuthorWork.Execute();
        }
Exemplo n.º 9
0
        public void RenameOriginalAuthor(int authorId, OriginalAuthorContract request)
        {
            var client = GetCodeListClient();

            client.UpdateOriginalAuthor(authorId, request);
        }
Exemplo n.º 10
0
 public CreateOriginalAuthorWork(PersonRepository personRepository, OriginalAuthorContract data) : base(personRepository.UnitOfWork)
 {
     m_personRepository = personRepository;
     m_data             = data;
 }
Exemplo n.º 11
0
 public int CreateOriginalAuthor([FromBody] OriginalAuthorContract author)
 {
     return(m_personManager.CreateOriginalAuthor(author));
 }