liubiao4123 / servicestack

Automatically exported from code.google.com/p/servicestack
0 stars 0 forks source link

Null reference exception on call to GetAll #70

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. see source below
2.
3.

What is the expected output? What do you see instead?
no crash

What version of the product are you using? On what operating system?
latest servicestack, VS 2008 and 2010 on Windows XP SP3

Please provide any additional information below.

using System;
using System.Collections.Generic;
using System.Text;
using ServiceStack.Redis;

namespace RedisClient1 {
    class Program {
        class Test {
            public String LastName;
            public String FirstName;
            public override string ToString() {
                return string.Format("Firstname={0}, Lastname={1}", FirstName, LastName);
            }
        }

        static void Main(string[] args) {
            var redis = new RedisClient("10.33.112.127", 6379);
            using (var testClass = redis.GetTypedClient<Test>()) {
                testClass.Store(new Test() {FirstName="a", LastName="b"});
                testClass.Store(new Test() { FirstName = "c", LastName = "d" });

                var members = testClass.GetAll();
                foreach (Test t in members)
                    t.ToString();
            }
        }
    }
}

Original issue reported on code.google.com by forevern...@googlemail.com on 30 May 2012 at 9:58

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Oops, was the missing getters and setters in class Test... Strange

Closed

Original comment by forevern...@googlemail.com on 30 May 2012 at 10:06