Пример #1
0
        /// <summary>
        /// Creates a new <see cref="EtpEndpointInfo"/> from a key.
        /// The endpoint's instance identifier is generated from the provided key.
        /// The key should be consistent for the same application name, application version and user details.
        /// </summary>
        /// <param name="applicationName">The endpoint's application name.</param>
        /// <param name="applicationVersion">The endpoint's application version.</param>
        /// <param name="key">The endpoint's key used to generate its instance identifier.</param>
        /// <returns>The new instance.</returns>
        public static EtpEndpointInfo FromKey(string applicationName, string applicationVersion, string key)
        {
            var instanceId = GuidUtility.CreateEnergisticsEtpGuid(key);

            return(new EtpEndpointInfo(applicationName, applicationVersion, instanceId));
        }
Пример #2
0
 /// <summary>
 /// Converts the UUID to a <see cref="Guid"/> instance.
 /// </summary>
 /// <param name="uuid">The UUID.</param>
 /// <returns>A new <see cref="Guid"/> instance.</returns>
 public static Guid ToGuid(this IUuid uuid)
 {
     return(!uuid.IsValidGuid()
          ? default(Guid)
          : new Guid(GuidUtility.GetSwappedBytes(uuid.Value)));
 }