I have WCF method that looks something like this:
public GetRecordsResponse GetRecords(GetRecordsRequest request)
{
GetRecordsResponse response = new GetRecordsResponse();
Util.GetRecords.VerifyMandatoryParameters(request);
//make sure mandatory parameters have correct values.
Util.GetRecords.SetDefaultValues(request);
Util.GetRecords.SetDefaultResponseValues(request, response);
DataReader.GetRecords.GetAllRecords(request, response);
return response;
}
Is it wrong that i have the entire DAL and many Helper methods as static classes and methods? If so, why?
As a result of using Static method you can access instance variables like properties and fields this means you need to pass the request to every method.
If you used instances of GetRecords you could do somehting liek
Also if you implment a fluent interfaces you could have written it like this.
But there’s nothing “wrong” with what you did