Need C# snippet for setting custom options

Automate and integrate using the SQL comparison API

Need C# snippet for setting custom options

Postby jason.coverston » Tue Aug 26, 2014 8:23 pm

This is what we have now. The WriteLine indicates that IgnoreWithNocheck is not part of the compareOptions object. And the compare behaves as if it is not there.

Options compareOptions = Options.None;

compareOptions.Plus(Options.Default);
compareOptions.Plus(Options.IgnorePermissions);
compareOptions.Plus(Options.IgnoreUserProperties);
compareOptions.Plus(Options.IgnoreUsers);
compareOptions.Plus(Options.IgnoreComments);
compareOptions.Plus(Options.IgnoreWithNocheck);

Console.Out.WriteLine(compareOptions.AreAllEnabled(Options.IgnoreWithNocheck).ToString());

Differences differences = _liveDatabase.CompareWith(snapshotDatabase, compareOptions);
jason.coverston
 
Posts: 2
Joined: Tue Aug 26, 2014 8:19 pm

Found the solution

Postby jason.coverston » Tue Aug 26, 2014 8:53 pm

compareOptions.Plus(Options.IgnorePermissions); does not work
compareOptions = compareOptions.Plus(Options.IgnorePermissions); does work
jason.coverston
 
Posts: 2
Joined: Tue Aug 26, 2014 8:19 pm

Postby stanori » Wed Aug 27, 2014 9:26 pm

Hello,

The Comparison SDK introduced a new way of using Options starting with version 10.5 and higher.

For your specific example, you can try something like this:

Options.Default.Plus(Options.IgnorePermissions,Options.IgnoreUserProperties,Options.IgnoreUsers,Options.IgnoreComments,Options.IgnoreWithNocheck)


For more details about the changes that were introduced in version 10.5 and higher, please see:

https://documentation.red-gate.com/disp ... n+SDK+10.5

Hope this helps.

Best Regards,
Steve
_________________
Steve Tanori
Product Support
Red Gate Software Ltd.
866-997-0378
stanori
 
Posts: 84
Joined: Mon Apr 23, 2012 12:13 pm


Return to SQL Comparison SDK Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests

cron