C# Web Application MySQL Data Access
Posted on 2014-04-17
I'm designing a c# class to retrieve data from MySQL in order to provide it to a C# Web Application which will be coded in the future by someone else. I would like to avoid passing parameters by reference and/or using out parameters. My question is what would be the "best" way to structure the class methods? Some of them will need to return just a success code with a success message. For these, I'm using something like :
int fail; // will be zero if successful
string failMessage; // will be empty if successful
ReturnValue returnValue ProcessPayroll(parameter1, parameter2);
Other methods will need to return rows of data along with some sort of success code. For these I'm using something like:
GetEmployeesReturnValue getEmployeesReturnValue getEmployees(parameter1, parameter2);
So, just about every method will have it's own class which encapsulates it's specific "return value".
Is this something a Web Application developer will be able to easily work with? Are there better ways for an intermediate C# programmer like myself to implement these data provider methods?
Thank you very much for reading. And, thank you in advance for whatever advice you might provide.