<commit_before>﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Smoother.IoC.Dapper.FastCRUD.Repository.UnitOfWork.Connection;
using Smoother.IoC.Dapper.FastCRUD.Repository.UnitOfWork.UoW;

namespace Smoother.IoC.Dapper.FastCRUD.Repository.UnitOfWork.Repo
{
    public interface IRepository<TSession, TEntity, in TPk>
        where TSession : ISession
        where TEntity : class
    {
        TEntity Get(TPk key, IUnitOfWork<TSession> unitOfWork = null);
        Task<TEntity> GetAsync(TPk key, IUnitOfWork<TSession> unitOfWork = null);
        IEnumerable<TEntity>  GetAll(IUnitOfWork<TSession> unitOfWork = null);
        Task<IEnumerable<TEntity>> GetAllAsync(IUnitOfWork<TSession> unitOfWork = null);

    }
}<commit_msg>Add SaveOrUpdate<commit_after>﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Smoother.IoC.Dapper.FastCRUD.Repository.UnitOfWork.Connection;
using Smoother.IoC.Dapper.FastCRUD.Repository.UnitOfWork.UoW;

namespace Smoother.IoC.Dapper.FastCRUD.Repository.UnitOfWork.Repo
{
    public interface IRepository<TSession, TEntity, TPk>
        where TEntity : class, ITEntity<TPk>
        where TSession : ISession
    {
        TEntity Get(TPk key, IUnitOfWork<TSession> unitOfWork = null);
        Task<TEntity> GetAsync(TPk key, IUnitOfWork<TSession> unitOfWork = null);
        IEnumerable<TEntity>  GetAll(IUnitOfWork<TSession> unitOfWork = null);
        Task<IEnumerable<TEntity>> GetAllAsync(IUnitOfWork<TSession> unitOfWork = null);
        TPk SaveOrUpdate(TEntity entity, IUnitOfWork<TSession> unitOfWork = null);
        Task<TPk> SaveOrUpdateAsync(TEntity entity, IUnitOfWork<TSession> unitOfWork = null);
    }
}
{'fraction_non_alphanumeric': 0.09864146485528648, 'fraction_numerical': 0.0, 'mean_word_length': 4.590759075907591, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '983017', 'n_tokens_mistral': 578, 'n_tokens_neox': 572, 'n_words': 97}