12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using CZFW.Framework.Model.ViewModel;
- using MongoDB.Bson;
- using System;
- namespace CZFW.MDB.Navigation
- {
- public class NavigationLogic : INavigation
- {
- IMongoRepository _repository;
- public NavigationLogic(IMongoRepository mongoRepository)
- {
- _repository = mongoRepository;
- _repository.SetCurrentTable("navigation");
- }
- public ResultModel Add(string navJson)
- {
- _repository.AsureTableExist("navigation");
- _repository.SetCurrentTable("navigation");
- var res = _repository.Insert(navJson);
- return res;
- }
- public BsonArray GetList(string sid)
- {
- var query = $"{{sid:'{sid}'}}";
- var list = _repository.GetList(query);
- return list;
- }
- public BsonDocument Get(string id)
- {
- var res = _repository.Get(id);
- return res;
- }
- public BsonDocument GetByName(string name)
- {
- throw new NotImplementedException();
- }
- public ResultModel Remove(string id)
- {
- return _repository.Remove(id);
- }
- public ResultModel Update(string id, string set, string arrayFilter = null)
- {
- throw new NotImplementedException();
- }
- public ResultModel Replace(string id, string newObjJson)
- {
- var tp = _repository.Replace(id, newObjJson);
- return tp;
- }
- }
- }
|