I'm sure this one is wrong. It's just dawned on me that it's violating SRP for starters - having a class that both builds an object and does the post to and endpoint is two responsibilities
Well, imagine that all these Api's are for auction sites like Ebay and Gumtree or whatever. In our database we have all sorts of "widgets" with fields like cost, rrp, description, dimensions and so on
But Ebay wants you to post XML and it wants all the price fields as decimals, with currenect listed separately. Whereas Gumtree wants JSON and wants prices as a single string ( e.g. "$400.50"). So each helper class takes our "widget" object and builds the approrpiate output for the api
@Wietlol Yes, I think we're thinking along the same lines. You're just calling it a client lib rather than a helper class
if you were an engineer, and you had to build a road which takes you to a place which is on the other side of a river and a mountain, you have to build a bridge but you don't have to go over the mountain
or through it
In other words, some things you must do to get you to your destination, while others are needlessly complicated
the trick is knowing when it's necessary and when it's not
For the last two decades or so I’ve admired the simplicity and power of the Python language without ever actually doing any work in it or learning about the details. Having recently dug into those details, I think it is … Continue reading →
Sit back and relax as I regale you with a harrowing account of trying to do something straightforward with CSS. Ha! Straightforward. How silly was I to think that. As they say,
I was hoping there's a way to auto do that when querying as this entire database uses CHAR for any string types.
I have a function that loops through all tables and all rows and for every string type column does .ToString().Trim(), but was wondering if there was a way for the DataAdapter to do it at the time of the filling
You should be able to in the SQL Statement depending on how you have it setup. or there is this example. https://stackoverflow.com/questions/17675253/trim-whitespace-from-all-dataset-fields
class Parent{
int parentId;
//Other stuff
ICollections<Child> childrenRef1;
ICollections<Child> childrenRef2;
}
class Child{
int childId;
int parentIdRef1; //Fk to parent.parentId
string relevantString;
int parentIdRef2;
virtual Parent p1;
virtual Parent p2;
}
@juanvan Yeah, Im using that linked solution as a way to clean up the data after. The problem trying to do it in the SQL statement is I have a lot of tables to select and it's a pain to write SELECT RTIM(Vendorname) AS Vendorname, RTIM(Vendoraddress1) AS Vendoraddress1, RTRIM(Vendoraddress2) AS Vendoraddress2 .... etc. I was wanting to just do SELECT * FROM VendorTable