Conversation
|
hi @wismna Thanks for the contribution ! Appreciate ! That being said, some remarks:
var setup = new SyncSetup("Customer");
// Add columns
setup.Tables["Employee"].Columns.AddRange("CustomerID", "FirstName", "LastName", "Title", "Suffix", "CompanyName", "rowGuid");
setup.Tables["Employee"].Columns.ExcludeRange("rowGuid", "LastModifiedDate");I know this example is kind of stupid, but if you think about some algorithm where colums are built using a loop or any dynamic routine, we can end up with such situation
If you look carefully By the way in method |
You're welcome !
Indeed we do, I'll get on it.
Well, I asked myself that same question, and I'm not sure there is a "right" answer. The way I see it, we have three possibilities:
What's your opinion on the subject ?
Oh, right, I missed that ! I'll fix it.
Perhaps I did not do that properly, but it's related to your second point: if we try to add a column that is already excluded, we raise an error as it kind of made no sense for me to have the same column both included and excluded. |
I guess we can use a kind of merge method
By the way, raising an error can also be a solution ... I don't know !
True ! |
Add unit tests
|
Hi ! So, I updated the code. After our discussions, I figured that I would implement it in a way where the last operation wins, as you described here:
Also, I added unit tests to cover these cases and used the same code to parse column name. Let me know what you think ! |
Currently, when no columns are specified in the setup, it will sync all the table columns.
This adds an column exclusion feature, so that all columns except the excluded ones will be synchronized. It allows for simpler configuration when tables have many columns and we only want to exclude a few.
The excluded columns will not be taken into account at all if columns are specified in the setup.