I have created a simple WCF service. I am writing a method to search certain entity based on some search criteria.
[OperationContract]
List<SiteDTO> GetList(int? siteID, string code, string name,
string notes, byte? status, string description,
int? modifiedBy, DateTime? modifiedDate, long?
timeStamp, int? pageNo, int? pageSize, out int?
totalRows, int x);
I have two questions here:
Should I pass the primitive variables to the service method or should I wrap them all in a class(i.e. SiteSearchDTO). and Why? Details please.
My second question is when I add the reference to the service in a project, I get the corresponding method generated there. But with a different signature in
Reference.cs
.
public System.Collections.Generic.List<RPMS.Web.SiteService.SiteDTO>
GetList(out System.Nullable<int> totalRows,
System.Nullable<int> siteID, string code, string name,
string notes, System.Nullable<byte> status, string description,
System.Nullable<int> modifiedBy,
System.Nullable<System.DateTime> modifiedDate,
System.Nullable<long> timeStamp,
System.Nullable<int> pageNo,
System.Nullable<int> pageSize, int x)
The issue is the generated method has int? totalRows as the first parameter but in original service method totalRows is second to last variable. Why?