예제 #1
0
        public void DeleteSuccess()
        {
            var model = new GetModelService().GetModel();

            _client.Add(model);
            Assert.Equal(1L, _client.Delete(model));
        }
예제 #2
0
        public void Add()
        {
            var model = new GetModelService().GetModel();

            _client.Add(model);
            var result = _client.GetQueryable <TestModel>().FirstOrDefault(p => p.Id == model.Id);

            Assert.NotNull(result);
            Assert.Equal(model.ToJson(), result.ToJson());
        }
예제 #3
0
        public void UpdateSuccess()
        {
            var model = new GetModelService().GetModel();

            _client.Add(model);
            model.Int         = 199;
            model.String      = Guid.NewGuid().ToString();
            model.DateTimeUtc = DateTime.UtcNow;
            _client.Update(model);
            var result = _client.GetQueryable <TestModel>().FirstOrDefault(p => p.Id == model.Id);

            Assert.Equal(model.ToJson(), result.ToJson());
        }
 public void Add(ArticleCategory article)
 {
     _client.Add(new ArticleCategoryEntity(article));
 }
예제 #5
0
 public void Add(Article article)
 {
     _client.Add(new ArticleEntity(article));
 }
예제 #6
0
 public void Add(Order order)
 {
     _mongoClient.Add(Convert(order));
     _cache.Add(order.Id, order);
 }