<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XOMNI.SDK.Core.ApiAccess;

namespace XOMNI.SDK.Core.Management
{
    public abstract class BaseCRUDManagement<T> : ManagementBase
    {
        protected abstract CRUDApiAccessBase<T> ApiAccess { get; }

        /// <summary>
        /// Adds a new entity
        /// </summary>
        /// <param name="entity">Entity to be added</param>
        /// <returns>Added entity</returns>
        public virtual Task<T> AddAsync(T entity)
        {
            return ApiAccess.PostAsync(entity, base.ApiCredential);
        }

        /// <summary>
        /// Delete entity by its id
        /// </summary>
        /// <param name="id">Entity id</param>
        /// <returns></returns>
        public virtual Task DeleteAsync(int id)
        {
            return ApiAccess.DeleteAsync(id, base.ApiCredential);
        }

        /// <summary>
        /// Updates an entity
        /// </summary>
        /// <param name="entity">Entity to be updated</param>
        /// <returns>Updated entity</returns>
        public virtual Task<T> UpdateAsync(T entity)
        {
            return ApiAccess.PutAsync(entity, base.ApiCredential);
        }

        /// <summary>
        /// Fetchs an entity by its id
        /// </summary>
        /// <param name="id">Entity id</param>
        /// <returns>Fetched entity</returns>
        public virtual Task<T> GetByIdAsync(int id)
        {
            return ApiAccess.GetByIdAsync(id, base.ApiCredential);
        }
    }
}
<commit_msg>added GetAllAsync method for BaseCRUDManagement class<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XOMNI.SDK.Core.ApiAccess;

namespace XOMNI.SDK.Core.Management
{
    public abstract class BaseCRUDManagement<T> : ManagementBase
    {
        protected abstract CRUDApiAccessBase<T> ApiAccess { get; }

        /// <summary>
        /// Adds a new entity
        /// </summary>
        /// <param name="entity">Entity to be added</param>
        /// <returns>Added entity</returns>
        public virtual Task<T> AddAsync(T entity)
        {
            return ApiAccess.PostAsync(entity, base.ApiCredential);
        }

        /// <summary>
        /// Delete entity by its id
        /// </summary>
        /// <param name="id">Entity id</param>
        /// <returns></returns>
        public virtual Task DeleteAsync(int id)
        {
            return ApiAccess.DeleteAsync(id, base.ApiCredential);
        }

        /// <summary>
        /// Updates an entity
        /// </summary>
        /// <param name="entity">Entity to be updated</param>
        /// <returns>Updated entity</returns>
        public virtual Task<T> UpdateAsync(T entity)
        {
            return ApiAccess.PutAsync(entity, base.ApiCredential);
        }

        /// <summary>
        /// Fetchs an entity by its id
        /// </summary>
        /// <param name="id">Entity id</param>
        /// <returns>Fetched entity</returns>
        public virtual Task<T> GetByIdAsync(int id)
        {
            return ApiAccess.GetByIdAsync(id, base.ApiCredential);
        }

        /// <summary>
        /// Returns a paged list of entity
        /// </summary>
        /// <param name="skip">The number of items in the collection to skip before executing a select.</param>
        /// <param name="take">The number of items that should be fetched from the collection.</param>
        /// <returns>CountedCollectionContainer of entity</returns>
        public virtual Task<Model.CountedCollectionContainer<T>> GetAllAsync(int skip, int take)
        {
            return ApiAccess.GetAllAsync(skip, take, base.ApiCredential);
        }
    }
}

{'fraction_non_alphanumeric': 0.12705452648056353, 'fraction_numerical': 0.0, 'mean_word_length': 1.9583333333333333, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 71, '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': '4664296', 'n_tokens_mistral': 1046, 'n_tokens_neox': 1042, 'n_words': 263}