Forum Discussion

David_Bond's avatar
David_Bond
Icon for Professor rankProfessor
3 months ago

LogicMonitor.Api nuget (C#/.NET library) v211 support and breaking changes

The LogicMonitor.Api nuget package for C#/.NET developers now has v211 support and some breaking changes.  Don't worry, we're still open source (contributions welcome) and the project team is here (and on Github) to help you transition your code.

We (the authors) have made the decision to lean fully into the renaming of "Device" to "Resource" throughout the library.  This includes classes like DeviceDataSource, which now becomes ResourceDataSource.  This work is mostly complete, though there will be a long tail of obscure Properties which may take us a little longer to get through.

We have made good use of the well-IDE-supported [Obsolete] attribute to help your migration.  For example, the Device class now looks like this, with all the POCO code moved to Resource.cs:

namespace LogicMonitor.Api.Devices;

/// <summary>
/// Obsolete
/// </summary>
[Obsolete("Use Resource instead", true)]
public class Device : Resource;

Note the use of error=true.  We have made the decision to force the upgrade, ensuring a clean and EARLY migration experience, with Visual Studio giving you hints with strikethrough and Intellisense hints like this:

No, not that... this!

This concept extends to properties:

(hostGroupId? how 2011)

...and methods:

Get all Resource processes in a single line of code? Wow!

We understand that there is some refactoring to do.  Our flagship Magic Suite systems of products only took an hour to migrate, and we made thousands of changes.  A combination of the Obsolete hints and good IDE-fu should make your project a breeze to upgrade also.

Shout here if you need help.

No RepliesBe the first to reply