src/EasyFrameWork/RepositoryPattern/IService.cs

(完整代码) 1KB

/* http://www.zkea.net/ 
 * Copyright (c) ZKEASOFT. All rights reserved. 
 * http://www.zkea.net/licenses */

using System;
using System.Linq.Expressions;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Storage;
using System.Linq;
using System.Threading.Tasks;

namespace Easy.RepositoryPattern
{
    public interface IService<T> : IDisposable
        where T : class
    {
        IApplicationContext ApplicationContext { get; set; }
        void BeginTransaction(Action action);
        ServiceResult<T> Add(T item);
        ServiceResult<T> AddRange(params T[] items);
        IQueryable<T> Get();
        T GetSingle(Expression<Func<T, bool>> filter);
        Task<T> GetSingleAsync(Expression<Func<T, bool>> filter);
        IList<T> Get(Expression<Func<T, bool>> filter);
        Task<IList<T>> GetAsync(Expression<Func<T, bool>> filter);
        IList<T> Get(Expression<Func<T, bool>> filter, Pagination pagination);
        Task<IList<T>> GetAsync(Expression<Func<T, bool>> filter, Pagination pagination);
        T Get(params object[] primaryKey);
        Task<T> GetAsync(params object[] primaryKey);
        int Count(Expression<Func<T, bool>> filter);
        Task<int> CountAsync(Expression<Func<T, bool>> filter);
        ServiceResult<T> Update(T item);
        ServiceResult<T> UpdateRange(params T[] items);
        void Remove(params object[] primaryKey);
        void Remove(T item);
        void Remove(Expression<Func<T, bool>> filter);
        void RemoveRange(params T[] items);
        void BeginBulkSave();
        void SaveChanges();
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。