internal DeleteQuery(IElasticPoco poco) : base(poco)
 {
     if (string.IsNullOrEmpty(poco.Id))
     {
         throw new ArgumentNullException(nameof(poco.Id));
     }
 }
        private string GenerateFieldMapping(IEnumerable <PropertyInfo> properties, IElasticPoco poco)
        {
            var propertiesAsJson = properties
                                   .Where(p => p.GetValue(poco) != null)
                                   .Select(p => $@"""{GetName(p.Name)}"": {EscapeValue(p.GetValue(poco))}");

            return(string.Join(",", propertiesAsJson));
        }
 protected Update(IElasticPoco poco) : base(poco)
 {
 }
 private IEnumerable <PropertyInfo> UpdatetableProperties(IElasticPoco poco) => poco.GetType().GetProperties().Where(p => !ExcludedProperties.Contains(p.Name));
        private string GenerateDocument(IElasticPoco poco)
        {
            var properties = UpdatetableProperties(poco);

            return($@"""doc"": {{ {GenerateFieldMapping(properties, poco)} }}");
        }
 public Upsert(IElasticPoco poco) : base(poco)
 {
 }
 protected AbstractConditionalQuery(IElasticPoco poco) : base(poco)
 {
 }
Example #8
0
 protected AbstractBaseQuery(IElasticPoco poco)
 {
     Poco      = poco ?? throw new ArgumentNullException(nameof(poco));
     IndexName = poco.Index ?? throw new ArgumentNullException(nameof(poco.Index));
     TypeName  = poco.Type ?? throw new ArgumentNullException(nameof(poco.Type));
 }
 protected Index(IElasticPoco poco) : base(poco)
 {
 }