예제 #1
0
        public async Task <IActionResult> AddGenericPage(GenericPageDto gen, CancellationToken cancellationToken)
        {
            try
            {
                int result = await _genService.AddGenericPage(gen, cancellationToken).ConfigureAwait(false);

                if (result == 0)
                {
                    return(BadRequest());
                }
                else
                {
                    return(Ok("Page Added Successfully"));
                }
            }
            catch (Exception ex)
            {
                await _errorlogService.InsertError(Request.GetDisplayUrl(), ControllerContext.ActionDescriptor.ActionName.ToString(), ex.Message, ex.ToString()).ConfigureAwait(false);

                return(StatusCode(500, ex.InnerException));
            }
        }