public IEnumerable<string> GetCategoryNames()
 {
     using (var connection = this.GetConnection())
     {
         var categoryQueryObject = new CategoryQueryObject();
         return connection.Query<string>(categoryQueryObject.GetCategoryNames());
     }
 }
        public void UpdateCategoryPicture(Category category)
        {
            if (category == null)
            {
                return;
            }

            using (var connection = this.GetConnection())
            {
                var categoryQueryObject = new CategoryQueryObject();
                connection.Execute(categoryQueryObject.UpdateCategoryImage(category.CategoryID, category.Picture));
            }
        }
        public Category GetByCategoryName(string categoryName)
        {
            using (var connection = this.GetConnection())
            {
                var categoryQueryObject = new CategoryQueryObject();
                var categories = connection.Query<Category>(categoryQueryObject.GetByCategoryName(categoryName)).ToList();

                if (!categories.Any())
                {
                    throw new EntityNotFoundException(string.Format("Category with {0} name is not found in database.", categoryName));
                }

                return categories.First();
            }
        }