
Untitled
By: a guest on
May 7th, 2012 | syntax:
None | size: 1.43 KB | hits: 79 | expires: Never
The type ExceptionPolicyImpl has multiple constructors of length 2. Unable to disambiguate
builder.ConfigureExceptionHandling()
// -----------------------------------------------------
// Preventing Enterprise Library Validation Block exceptions from getting shielded.
// -----------------------------------------------------
.GivenPolicyWithName("WCF Exception Shielding")
.ForExceptionType<FaultException<ValidationFault>>()
.ThenDoNothing()
// -----------------------------------------------------
// Shielding unhandled exceptions
// -----------------------------------------------------
.ForExceptionType<Exception>()
.LogToCategory("My Logging Category")
.WithSeverity(TraceEventType.Critical)
.ShieldExceptionForWcf(typeof(ServiceUnhandledFault), Resources.UnhandledException_ErrorMessage)
.ThenThrowNewException();
[ServiceContract]
[ValidationBehavior]
[ExceptionShielding("WCF Exception Shielding")]
public interface IMyService
{
[OperationContract]
[FaultContract(typeof(ValidationFault))]
[FaultContract(typeof(ServiceUnhandledFault))]
void InsertEntity(MyEntity file);
}
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.PerCall)]
public partial class MyService : IMyService { ...Implementation... }