/// <summary> /// Initializes a new instance of the <see cref="DistributedObjectBase"/> class. /// </summary> /// <param name="serviceName">the name of the service managing this object.</param> /// <param name="name">The unique name of the object.</param> /// <param name="cluster">A cluster.</param> /// <param name="serializationService">A serialization service.</param> /// <param name="loggerFactory">A logger factory.</param> protected DistributedObjectBase(string serviceName, string name, DistributedObjectFactory factory, Cluster cluster, ISerializationService serializationService, ILoggerFactory loggerFactory) { if (string.IsNullOrWhiteSpace(serviceName)) throw new ArgumentException(ExceptionMessages.NullOrEmpty, nameof(serviceName)); ServiceName = serviceName; if (string.IsNullOrWhiteSpace(name)) throw new ArgumentException(ExceptionMessages.NullOrEmpty, nameof(name)); Name = name; _factory = factory ?? throw new ArgumentNullException(nameof(factory)); Cluster = cluster ?? throw new ArgumentNullException(nameof(cluster)); SerializationService = serializationService ?? throw new ArgumentNullException(nameof(serializationService)); LoggerFactory = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory)); }
/// <summary> /// Initializes a new instance of the <see cref="TransactionalDistributedObjectBase"/> class. /// </summary> /// <param name="serviceName">the name of the service managing this object.</param> /// <param name="name">The unique name of the object.</param> /// <param name="factory">The factory that owns this object.</param> /// <param name="cluster">A cluster.</param> /// <param name="transactionClientConnection">The client connection supporting the transaction.</param> /// <param name="transactionId">The unique identifier of the transaction.</param> /// <param name="serializationService">A serialization service.</param> /// <param name="loggerFactory">A logger factory.</param> protected TransactionalDistributedObjectBase(string serviceName, string name, DistributedObjectFactory factory, Cluster cluster, MemberConnection transactionClientConnection, Guid transactionId, SerializationService serializationService, ILoggerFactory loggerFactory) : base(serviceName, name, factory, cluster, serializationService, loggerFactory) { TransactionId = transactionId; TransactionClientConnection = transactionClientConnection; }