| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | using CoreWCF.Description; |
| | | 6 | | |
| | | 7 | | namespace CoreWCF |
| | | 8 | | { |
| | | 9 | | [AttributeUsage(CoreWCFAttributeTargets.OperationContract, AllowMultiple = true, Inherited = false)] |
| | | 10 | | public sealed class FaultContractAttribute : Attribute |
| | | 11 | | { |
| | | 12 | | private string _action; |
| | | 13 | | private string _name; |
| | | 14 | | private string _ns; |
| | | 15 | | |
| | 1111 | 16 | | public FaultContractAttribute(Type detailType) |
| | | 17 | | { |
| | 1111 | 18 | | DetailType = detailType ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(detailTyp |
| | 1111 | 19 | | } |
| | | 20 | | |
| | 294 | 21 | | public Type DetailType { get; } |
| | | 22 | | |
| | | 23 | | public string Action |
| | | 24 | | { |
| | 162 | 25 | | get { return _action; } |
| | | 26 | | set |
| | | 27 | | { |
| | 0 | 28 | | _action = value ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(value)); |
| | 0 | 29 | | } |
| | | 30 | | } |
| | | 31 | | |
| | | 32 | | public string Name |
| | | 33 | | { |
| | 324 | 34 | | get { return _name; } |
| | | 35 | | set |
| | | 36 | | { |
| | 186 | 37 | | if (value == null) |
| | | 38 | | { |
| | 0 | 39 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(value)); |
| | | 40 | | } |
| | | 41 | | |
| | 186 | 42 | | if (value == string.Empty) |
| | | 43 | | { |
| | 0 | 44 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(val |
| | 0 | 45 | | SR.SFxNameCannotBeEmpty)); |
| | | 46 | | } |
| | | 47 | | |
| | 186 | 48 | | _name = value; |
| | 186 | 49 | | } |
| | | 50 | | } |
| | | 51 | | |
| | | 52 | | public string Namespace |
| | | 53 | | { |
| | 162 | 54 | | get { return _ns; } |
| | | 55 | | set |
| | | 56 | | { |
| | 16 | 57 | | if (!string.IsNullOrEmpty(value)) |
| | | 58 | | { |
| | 16 | 59 | | NamingHelper.CheckUriProperty(value, "Namespace"); |
| | | 60 | | } |
| | | 61 | | |
| | 16 | 62 | | _ns = value; |
| | 16 | 63 | | } |
| | | 64 | | } |
| | | 65 | | } |
| | | 66 | | } |