I think there is an issue with the C# code generated when a DTO contains a byte?[] or DateTime?[] property.
I noticed this as the T4 template for OrmLite to generate DTO’s and the associated QueryType produces the Query classes with byte?[] and DateTime?[] properties for Nullable byte and DateTime columns in the DTO.
The problem is the resultant property generated by /types/chsarp (and thus C# ServiceStack clients who add a ServiceStack reference) looks like this:
public virtual Nullable DisplayOrderIn { get; set; }
I think it should be like this:
public virtual byte?[] DisplayOrderIn { get; set; }
I’ve tested this on 4.5.12 and also the 4.5.13 on MyGet moments ago.
EDIT: I should add that the currently generated C# code won’t compile.
A simple repro is:
-
Create a new ServiceStack self hosted c# project from the template in Visual Studio
-
Add to the Hello DTO a byte?[] or DateTime?[] property - e.g.:
[Route("/hello/{Name}")]
public class Hello : IReturn
{
public string Name { get; set; }
public DateTime?[] DateTimeTestIn { get; set; }
public byte?[] byteTestIn { get; set; }
} -
Run the project, and visit the /types/csharp route to see the generated code:
[Route("/hello/{Name}")]
public partial class Hello
: IReturn
{
public virtual string Name { get; set; }
public virtual Nullable DateTimeTestIn { get; set; }
public virtual Nullable byteTestIn { get; set; }
}