Ejemplo n.º 1
0
        public DatabaseEndpoint(
            long id,
            string host,
            ILocation location,
            ushort port = 3306,
            DatabaseEndpointFlags flags = default)
        {
            Ensure.IsValidId(id);
            Ensure.NotNull(host, nameof(host));
            Ensure.NotNull(location, nameof(location));

            Id         = id;
            Host       = host;
            Port       = port;
            Flags      = flags;
            LocationId = location.Id;
        }
Ejemplo n.º 2
0
        public RegisterDatabaseEndpointRequest(
            string host,
            int port,
            DatabaseEndpointFlags flags,
            ILocation location = null)
        {
            Ensure.NotNullOrEmpty(host, nameof(host));

            #region Preconditions

            if (port <= 0)
            {
                throw new ArgumentException("Must be > 0", nameof(port));
            }

            #endregion

            Host       = host;
            Port       = port;
            Flags      = flags;
            LocationId = location?.Id;
        }