예제 #1
0
        public async Task <IActionResult> CreateEbook(EBookModel model)
        {
            var username = ApplicationUtility.GetTokenAttribute(Request.Headers["Authorization"], "sub");
            var service  = new PublisherRepositoryService(connString);
            var pubId    = await service.CreateEBook(model, username);

            var response = new GenericResponse <int>()
            {
                IsSuccess    = true,
                Message      = "Ebook created successfully.",
                ResponseCode = 200,
                Result       = pubId
            };

            return(Ok(response));
        }