Constructor DmsService
- Namespace
- Skyline.DataMiner.Core.DataMinerSystem.Common
- Assembly
- Skyline.DataMiner.Core.DataMinerSystem.Common.dll
DmsService(IDms, DmsServiceId)
Initializes a new instance of the DmsService class.
public DmsService(IDms dms, DmsServiceId dmsServiceId)
Parameters
dms
IDmsObject implementing IDms interface.
dmsServiceId
DmsServiceIdThe system-wide service ID.
Remarks
This constructor can be used as an alternative to the GetService(DmsServiceId) method. The GetService(DmsServiceId) will in the background perform an SLNet call to request info about the service. Using this constructor, this additional SLNet call will not always be performed, which can improve performance. However, if you create a DmsService object with a DmsServiceId that does not exist on the System, an ServiceNotFoundException will only be thrown when a call to the server is performed. Using the GetService(DmsServiceId) method will already throw an exception if the service does not exist when the method executes.
In summary, you can use this constructor if you are sure the service exists which can result in improved performance because some additional SLNet calls can be avoided.
If you do not know the service exists, you should use the <xref href="Skyline.DataMiner.Core.DataMinerSystem.Common.IDms.GetService(Skyline.DataMiner.Core.DataMinerSystem.Common.DmsServiceId)" data-throw-if-not-resolved="false"></xref> method.
</p>
Exceptions
- ArgumentNullException
dms
is null.