网站首页 网站源码
website
站点相关全部源代码,隐藏了一些关于服务器的信息
using System.Collections.Generic;
using System.Threading.Tasks;
using MongoDB.Bson;
using MongoDB.Driver;

namespace Dpz.Core.MongodbAccess;

public interface IRepositoryAny : IRepository
{
    /// <summary>
    /// 获取所有集合名称
    /// </summary>
    /// <returns></returns>
    Task<List<string>> GetAllCollectionAsync();

    /// <summary>
    /// 获取集合数据
    /// </summary>
    /// <param name="collectionName"></param>
    /// <param name="filter"></param>
    /// <returns></returns>
    Task<List<BsonDocument>> GetCollectionDataAsync(string collectionName, FilterDefinition<BsonDocument>? filter = null);

    /// <summary>
    /// 给指定的集合插入数据
    /// </summary>
    /// <param name="collectionName"></param>
    /// <param name="source"></param>
    /// <returns></returns>
    Task InsertAsync(string collectionName,ICollection<BsonDocument> source);

    /// <summary>
    /// 删除所有数据
    /// </summary>
    /// <param name="collectionName"></param>
    /// <returns></returns>
    Task DeleteAllAsync(string collectionName);
}
loading