Represents a registered server in a multiple-servers environment.
The ServerRegistration class represents a registered server in a multiple-servers environment.
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
All samples in this document will require references to the following dll:
Umbraco.Core.dll
All samples in this document will require the following using statement:
Constructor for creating a new ServerRegistration object. The necessary parameters are the serverAddress as a string, the serverIdentity as a string and the date and time of registration as a DateTime
A second constructor exists but it should not be used because it is used to reconstruct a ServerRegistration from the data source.
Gets the date and time the registration was last accessed.
Gets or sets a value indicating whether the server is active.
Gets or sets a value indicating whether the server has the SchedulingPublisher role
Gets the date and time the registration was created.
Gets or sets the server URL.
Gets or sets the server unique identity.
using Umbraco.Cms.Core.Models;// Given a `IServerRegistrationService` object get the first ServerRegistration and return Accessed
var serverRegistration = serverRegistrationService.GetActiveServers().FirstOrDefault();
return serverRegistration.Accessed;// Given a `IServerRegistrationService` object get the first ServerRegistration and return IsActive
var serverRegistration = serverRegistrationService.GetActiveServers().FirstOrDefault();
return serverRegistration.IsActive;// Given a `IServerRegistrationService` object get the first ServerRegistration and return IsSchedulingPublisher
var serverRegistration = serverRegistrationService.GetActiveServers().FirstOrDefault();
return serverRegistration.IsSchedulingPublisher;// Given a `IServerRegistrationService` object get the first ServerRegistration and return Registered
var serverRegistration = serverRegistrationService.GetActiveServers().FirstOrDefault();
return serverRegistration.Registered;// Given a `IServerRegistrationService` object get the first ServerRegistration and return ServerAddress
var serverRegistration = serverRegistrationService.GetActiveServers().FirstOrDefault();
return serverRegistration.ServerAddress;// Given a `IServerRegistrationService` object get the first ServerRegistration and return ServerIdentity
var serverRegistration = serverRegistrationService.GetActiveServers().FirstOrDefault();
return serverRegistration.ServerIdentity;