Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void DoGenericValidation(VatDeclaration declaration)
- {
- DoGenericValidation<VatDeclarationException>(declaration);
- }
- public static void DoGenericValidation(IcpDeclaration declaration)
- {
- DoGenericValidation<IcpDeclarationException>(declaration);
- }
- private static void DoGenericValidation<T>(DeclarationBase declaration) where T : Exception, new()
- {
- if(declaration.Period != "Corrent")
- throw new T("Error01", "Period is wrong");
- throw new T("Error02", "Something else is wrong");
- }
- public class IcpDeclarationException : FaultException
- {
- public IcpDeclarationException(string code, string description)
- : base(new FaultReason(description), new FaultCode("AI" + code))
- {
- }
- public string OnzeCode { get; set; }
- }
Advertisement
Add Comment
Please, Sign In to add comment