Пример #1
0
		public void UpdateUsingPartial()
		{
			var originalProject = new ElasticsearchProject { Id = 1, Name = "NeST", Country = "UK" };
			var partialUpdate = new PartialElasticsearchProject { Name = "NEST", Country = "Netherlands" };

			var s = new UpdateDescriptor<ElasticsearchProject, PartialElasticsearchProject>()
				.IdFrom(originalProject) //only used to infer the id
				.Doc(partialUpdate); //the actual partial update statement;

			this.JsonEquals(s, MethodBase.GetCurrentMethod());
		}
Пример #2
0
        public void UpdateUsingPartial()
        {
            var originalProject = new ElasticsearchProject {
                Id = 1, Name = "NeST", Country = "UK"
            };
            var partialUpdate = new PartialElasticsearchProject {
                Name = "NEST", Country = "Netherlands"
            };

            var s = new UpdateDescriptor <ElasticsearchProject, PartialElasticsearchProject>()
                    .IdFrom(originalProject)         //only used to infer the id
                    .Doc(partialUpdate);             //the actual partial update statement;

            this.JsonEquals(s, MethodBase.GetCurrentMethod());
        }