using Bootstrap.Security;
using MongoDB.Driver;
using System.Collections.Generic;
using System.Linq;
namespace Bootstrap.DataAccess.MongoDB
{
///
///
///
public class Dict : DataAccess.Dict
{
///
///
///
///
public override IEnumerable RetrieveDicts() => MongoDbAccessManager.Dicts.Find(FilterDefinition.Empty).ToList();
///
///
///
///
///
public override bool DeleteDict(IEnumerable value)
{
var list = new List>();
foreach (var id in value)
{
list.Add(new DeleteOneModel(Builders.Filter.Eq(md => md.Id, id)));
}
MongoDbAccessManager.Dicts.BulkWrite(list);
return true;
}
}
}