<commit_before>﻿using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BizwebSharp.Infrastructure;
using BizwebSharp.Options;

namespace BizwebSharp
{
    public class BlogService : BaseService
    {
        public BlogService(BizwebAuthorizationState authState) : base(authState)
        {
        }

        public virtual async Task<int> CountAsync(BlogOption options = null)
        {
            return await MakeRequest<int>("blogs/count.json", HttpMethod.GET, "count", options);
        }

        public virtual async Task<IEnumerable<Blog>> ListAsync(BlogOption options = null)
        {
            return await MakeRequest<List<Blog>>("blogs.json", HttpMethod.GET, "blogs", options);
        }

        public virtual async Task<Blog> GetAsync(long id, string fields = null)
        {
            dynamic option = null;
            if (!string.IsNullOrEmpty(fields))
            {
                option = new { fields };
            }

            return await MakeRequest<Blog>($"blogs/{id}.json", HttpMethod.GET, "blog", option);
        }

        public virtual async Task<Blog> CreateAsync(Blog blog, IEnumerable<MetaField> metafields = null)
        {
            var body = blog.ToDictionary();

            if (metafields != null && metafields.Any())
            {
                body["metafields"] = metafields;
            }

            return await MakeRequest<Blog>($"blogs.json", HttpMethod.POST, "blog", new {blog = body});
        }

        public virtual async Task<Blog> UpdateAsync(long blogId, Blog blog, IEnumerable<MetaField> metafields = null)
        {
            var body = blog.ToDictionary();

            if (metafields != null && metafields.Any())
            {
                body["metafields"] = metafields;
            }

            return await MakeRequest<Blog>($"blogs/{blogId}.json", HttpMethod.PUT, "blog", new {blog = body});
        }

        public virtual async Task DeleteAsync(long id)
        {
            await MakeRequest($"blogs/{id}.json", HttpMethod.DELETE);
        }
    }
}<commit_msg>change BlogService to inheritance BaseServiceWithSimpleCRUD<commit_after>﻿using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BizwebSharp.Infrastructure;
using BizwebSharp.Options;

namespace BizwebSharp
{
    public class BlogService : BaseServiceWithSimpleCRUD<Blog, BlogOption>
    {
        public BlogService(BizwebAuthorizationState authState) : base(authState)
        {
        }
    }
}
{'fraction_non_alphanumeric': 0.10547184773988898, 'fraction_numerical': 0.0, 'mean_word_length': 2.423337856173677, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3216046', 'n_tokens_mistral': 710, 'n_tokens_neox': 677, 'n_words': 157}