public void Merge([NotNull] RowBuilder toRowBuilder)
 {
     foreach (var line in toRowBuilder.RowValues)
     {
         RowValues.Add(new RowValue(line.Name, line.Value));
     }
 }
Пример #2
0
        public List <RowValue> GetRowForDatabase()
        {
            RowBuilder rb = new RowBuilder();
            object     o  = this;

            rb.Add("MessagePack", LZ4MessagePackSerializer.Serialize((T)o));
            SetAdditionalFieldsForRow(rb);
            return(rb.RowValues);
        }
        public static RowBuilder GetAllProperties([NotNull] object o)
        {
            var rb         = new RowBuilder();
            var properties = o.GetType().GetProperties();

            foreach (PropertyInfo property in properties)
            {
                var shouldIgnoreAttribute = Attribute.IsDefined(property, typeof(RowBuilderIgnoreAttribute));
                if (shouldIgnoreAttribute)
                {
                    continue;
                }

                object val = property.GetValue(o);
                if (o is List <string> mylist)
                {
                    val = string.Join(",", mylist);
                }

                rb.Add(property.Name, val);
            }

            return(rb);
        }
        public static RowBuilder Start([NotNull] string name, [CanBeNull] object content)
        {
            var rb = new RowBuilder();

            return(rb.Add(name, content));
        }
Пример #5
0
 protected abstract void SetAdditionalFieldsForRow([NotNull] RowBuilder rb);