You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
935 B
36 lines
935 B
using SqlSugar;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Wood.Data.Repository;
|
|
|
|
namespace Wood.Service
|
|
{
|
|
/// <summary>
|
|
/// Manager父类
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
public class ApiManager<T> where T : class, new()
|
|
{
|
|
private readonly SqlSugarRepository<T> _repository;
|
|
/// <summary>
|
|
/// 可查询对象
|
|
/// </summary>
|
|
public ISugarQueryable<T> AsQueryable() => _repository.AsQueryable();
|
|
/// <summary>
|
|
/// 仓储
|
|
/// </summary>
|
|
public SqlSugarRepository<T> AsRepository() => _repository;
|
|
/// <summary>
|
|
/// 构造函数
|
|
/// </summary>
|
|
/// <param name="repository"></param>
|
|
public ApiManager(SqlSugarRepository<T> repository)
|
|
{
|
|
_repository = repository;
|
|
}
|
|
|
|
}
|
|
}
|
|
|