In a Request DTO on my server in C# I have the following
[ApiMember(Name = "ServiceItems", Description = "A list of service item objects. The list must contain at least ONE item.",
ParameterType = "path", DataType = "Array", IsRequired = true)]
[DataMember(Order = 18)]
public IList<BscServiceItem> ServiceItems { get; set; }
When generating the Dart code with the ServiceStack plugin in Android studio I the the following errors:
- Undefined class ‘IList’
- The function ‘IList’ isn’t defined
The generated Dart Code looks as follows (the lines where the errors are reported)
/**
* A list of service item objects. The list must contain at least ONE item.
*/
// @DataMember(Order=18)
// @ApiMember(DataType="Array", Description="A list of service item objects. The list must contain at least ONE item.", IsRequired=true, Name="ServiceItems", ParameterType="path")
IList<BscServiceItem>? serviceItems;
// and a view thousand lines later
'IList<BscServiceItem>': TypeInfo(TypeOf.Class, create:() => IList<BscServiceItem>()),
If I replace IList<T>
with List<T>
in C# the generated Code in Dart is OK. I can’t remember having problems with that when creating C# client files from VisualStudio in my old WPF clients…
Is there a general recommendation what types one should avoid when the server must support clients using different programming languages?