示例#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>()
                .Object(originalProject) //only used to infer the id
                .Document(partialUpdate); //the actual partial update statement;

            this.JsonEquals(s, MethodInfo.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>()
                    .Object(originalProject)             //only used to infer the id
                    .Document(partialUpdate);            //the actual partial update statement;

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