You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the following class:
public class C
{
public int? A { get; set; }
public int? B { get; set; }
}
The following statements do not show correct output:
var c1 = new C { A = 1, B = 2 };
var c2 = new C { A = null, B = 2 };
var s1 = QueryStringSerializer.SerializeToString(c1); // = "A=1&B=2"
var s2 = QueryStringSerializer.SerializeToString(c2); // = ""
After some testing it appears all null properties will lead to following
properties not being output. I think it's due to WriteQueryString in
ServiceStack.Text.Common.WriteType
:
foreach (var propertyWriter in PropertyWriters)
{
var propertyValue = propertyWriter.GetterFn((T)value);
if (propertyValue == null) return;
...
}
Looks like that return should be a break.
Original issue reported on code.google.com by GrimaceO...@gmail.com on 25 Aug 2010 at 6:39
The text was updated successfully, but these errors were encountered:
Yep that would do the trick.
Thanks for reporting and finding the bug - you're example is now apart of
ServiceStack, as a test case :)
Fix is attached.
Original comment by demis.be...@gmail.com on 25 Aug 2010 at 7:01
Original issue reported on code.google.com by
GrimaceO...@gmail.com
on 25 Aug 2010 at 6:39The text was updated successfully, but these errors were encountered: