public async Task <ErrorTemplate> Update(int applicationId, int id, IErrorRestBase errorResponse)
        {
            try
            {
                var result = await _dbContext.ErrorTemplates.SingleOrDefaultAsync(x => x.Id == id && x.ApplicationId == applicationId);

                result.ApplicationErrorCode = errorResponse.ApplicationErrorCode;
                result.ErrorDetail          = errorResponse.SerializeJson();

                _dbContext.ErrorTemplates.Update(result);
                await _dbContext.SaveChangesAsync();

                return(result);
            }
            catch (Exception e)
            {
                _logger.LogError($"[{System.Reflection.MethodBase.GetCurrentMethod().Name}] {e.Message ?? ""}", e);
                throw;
            }
        }
        public async Task <ErrorTemplate> Create(int applicationId, IErrorRestBase errorResponse)
        {
            try
            {
                var result = new ErrorTemplate {
                    ApplicationErrorCode = errorResponse.ApplicationErrorCode, ApplicationId = applicationId, ErrorDetail = errorResponse.SerializeJson()
                };

                _dbContext.ErrorTemplates.Add(result);
                await _dbContext.SaveChangesAsync();

                return(result);
            }
            catch (Exception e)
            {
                _logger.LogError($"[{System.Reflection.MethodBase.GetCurrentMethod().Name}] {e.Message ?? ""}", e);
                throw;
            }
        }