/// <summary> /// Initialises a new instance of <see cref="ExportServiceAttribute" />. /// </summary> /// <param name="name">The name of the service.</param> /// <param name="serviceType">The service type.</param> public ExportServiceAttribute(string name, string description, Type serviceType, Type contactType, int order = 1, TokenValidationMode mode = TokenValidationMode.Check) : base(typeof(IHostedService)) { if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentException("Name is a required parameter.", "name"); } if (serviceType == null) { throw new ArgumentNullException("serviceType"); } if (order < 0) { throw new ArgumentException("Order is must great than zero.", "order"); } Name = name; Description = description; ServiceType = serviceType; ContactType = contactType; Order = order; TokenValidationMode = mode; }
/// <summary> /// Initialises a new instance of <see cref="ExportServiceAttribute" />. /// </summary> /// <param name="name">The name of the service.</param> /// <param name="serviceType">The service type.</param> public ExportServiceAttribute(string name, string description, Type serviceType, Type contactType, int order = 1, TokenValidationMode mode = TokenValidationMode.Check) : base(typeof(IHostedService)) { if (string.IsNullOrWhiteSpace(name)) throw new ArgumentException("Name is a required parameter.", "name"); if (serviceType == null) throw new ArgumentNullException("serviceType"); if (order < 0) throw new ArgumentException("Order is must great than zero.", "order"); Name = name; Description = description; ServiceType = serviceType; ContactType = contactType; Order = order; TokenValidationMode = mode; }