I have a method called SubmitRequest wich takes a request object. It fills in some additional values like the sequence id the DB generates and submitted date. Then returns the same object. Is it better to just leave it as a VOID method?
Request request = JsonConvert.DeserializeObject<Request >(jsonFormData);
RequestManager frMan = new RequestManager();
//frMan.SubmitRequest updates the request object by updating some of its properties.
request = frMan.SubmitRequest(request);
return request;
A void would still work as the request would be modified:
frMan.SubmitRequest(request);
but are there any advantages or disadvantages of these two ways?
There’s no harm in writing it that way. In fact, it’s the basis of a fluent interface.