Ejemplo n.º 1
0
        public static TestCustomSerializerClass CustomDeserializeFunction(Document doc)
        {
            var obj = new TestCustomSerializerClass();

            obj.PropStringList = TestCustomSerializerClass.StringToCustomList(doc.Get("CustomList"));

            return(obj);
        }
Ejemplo n.º 2
0
        public static Document CustomMapperFunction(TestCustomSerializerClass obj)
        {
            var doc = new Document();

            doc.Add(new Field("CustomList", TestCustomSerializerClass.CustomListToString(obj.PropStringList), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            return(doc);
        }
Ejemplo n.º 3
0
        public static Document CustomMapperFunction(TestCustomSerializerClass obj)
        {
            var doc = new Document();

            doc.Add(new Field("CustomList", TestCustomSerializerClass.CustomListToString(obj.PropStringList), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            return doc;
        }
Ejemplo n.º 4
0
        public static TestCustomSerializerClass CustomDeserializeFunction(Document doc)
        {
            var obj = new TestCustomSerializerClass();

            obj.PropStringList = TestCustomSerializerClass.StringToCustomList(doc.Get("CustomList"));

            return obj;
        }
Ejemplo n.º 5
0
        public static Document CustomMapperFunction3(TestCustomSerializerClass obj)
        {
            var doc = new Document();

            doc.Add(new Field("PropStringList", string.Join(",", obj.PropStringList), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            doc.Add(new Field("StringList", string.Join(",", obj.StringList), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            doc.Add(new Field("IntList", string.Join(",", obj.IntList), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            doc.Add(new Field("PropIntList", string.Join(",", obj.PropIntList), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            return(doc);
        }
Ejemplo n.º 6
0
        public static Document CustomMapperFunction3(TestCustomSerializerClass obj)
        {
            var doc = new Document();

            doc.Add(new Field("PropStringList", string.Join(",", obj.PropStringList), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            doc.Add(new Field("StringList", string.Join(",", obj.StringList), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            doc.Add(new Field("IntList", string.Join(",", obj.IntList), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            doc.Add(new Field("PropIntList", string.Join(",", obj.PropIntList), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            return doc;
        }
Ejemplo n.º 7
0
        public static TestCustomSerializerClass CustomMapperFunction2(Document doc)
        {
            var obj = new TestCustomSerializerClass();

            obj.PropStringList = doc.Get("PropStringList").Split(new[] { "," }, StringSplitOptions.None).ToList();

            obj.StringList = doc.Get("StringList").Split(new[] { "," }, StringSplitOptions.None).ToList();

            obj.IntList = doc.Get("IntList").Split(new[] { "," }, StringSplitOptions.None)
                          .Select(int.Parse)
                          .ToList();

            obj.PropIntList = doc.Get("PropIntList").Split(new[] { "," }, StringSplitOptions.None)
                              .Select(int.Parse)
                              .ToList();

            return(obj);
        }
Ejemplo n.º 8
0
        public static TestCustomSerializerClass CustomMapperFunction2(Document doc)
        {
            var obj = new TestCustomSerializerClass();

            obj.PropStringList = doc.Get("PropStringList").Split(new[] { "," }, StringSplitOptions.None).ToList();

            obj.StringList = doc.Get("StringList").Split(new[] { "," }, StringSplitOptions.None).ToList();

            obj.IntList = doc.Get("IntList").Split(new[] {","}, StringSplitOptions.None)
                .Select(int.Parse)
                .ToList();

            obj.PropIntList = doc.Get("PropIntList").Split(new[] { "," }, StringSplitOptions.None)
                .Select(int.Parse)
                .ToList();

            return obj;
        }