public void Log(Exception exception)
        {
            var exceptionToLog = new ExceptionLog
            {
                Date           = _dateTimeFacade.GetCurrentTime(),
                Message        = exception.Message,
                InnerException = exception.InnerException?.Message,
                StackTrace     = exception.StackTrace
            };

            _candyStoreRepository.Insert(exceptionToLog);
        }
        public OperationValidationResult AddNewCategory(string name, byte[] image)
        {
            var result = new OperationValidationResult()
            {
                Valid = true
            };

            if (string.IsNullOrEmpty(name) || image == null)
            {
                result.Valid = false;
                result.AddErrorMessage("Category image or category name were not set");
                return(result);
            }

            _candyStoreRepository.Insert(new Category
            {
                Name          = name,
                CategoryImage = image
            });

            return(result);
        }