Need C# snippet for setting custom options

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);

Comments

  • compareOptions.Plus(Options.IgnorePermissions); does not work
    compareOptions = compareOptions.Plus(Options.IgnorePermissions); does work
  • 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
Sign In or Register to comment.