예제 #1
0
        public async Task <ActionResult <AuthorEntity> > Store(AuthorEntity author)
        {
            dynamic creating = await _createService.Create(author);

            if (creating.status == true)
            {
                return(Ok(_helpers.SuccessResponse(creating.message, creating.data)));
            }
            else
            {
                return(StatusCode(500, _helpers.ErrorResponse("Error To create", new string[] { creating.message })));
            }
        }
예제 #2
0
 public ActionResult <object> Error()
 {
     return(StatusCode(500, _helpers.ErrorResponse("Error To create", new string[] { "error 1", "error 2" })));
 }