Subsonic 3 + LINQ bug

subsonicsubsonic3

A weird bug with Subsonic 3.0.0.3

Using – as an example – AdventureWorksLT DB

When I run this code

I get null for gname (although name gets the value ok)
And w is 0 instead of the value in the 1st row
[If I change select new MyData to just select MyData – it works OK]

class Program {
    static void Main(string[] args) {

        var q = from g in Product.All()
                select new MyData{
                    gname = g.Name,
                    name = g.Name,
                    w = g.Weight.Value
                };
        var list00 = q.Take(1).ToList();
        Console.WriteLine(list00[0].gname);
    }
}
public class MyData {
    public string gname { get; set; }
    public string name { get; set; }
    public decimal w { get; set; }
}

Any ideas what is wrong

Thanks

Mike

Related Topic