Esempio n. 1
0
 public AttributeSpecificationServiceInterceptor(ServiceTypeValidator serviceTypeValidator, AttributeSpecificationValidator attributeSpecificationValidator)
 {
     _serviceTypeValidator            = serviceTypeValidator;
     _attributeSpecificationValidator = attributeSpecificationValidator;
     BuildUp(new Dictionary <string, Action <IInvocation> >
     {
         {
             nameof(CreateAttributeSpecificationAsync),
             x => CreateAttributeSpecificationAsync((ServiceAttributeSpecification)x.Arguments[0])
         },
         {
             nameof(GetAllSpecificationsForTypeAsync),
             x => GetAllSpecificationsForTypeAsync((int)x.Arguments[0])
         },
         {
             nameof(UpdateAttributeSpecificationAsync),
             x => UpdateAttributeSpecificationAsync((ServiceAttributeSpecification)x.Arguments[0])
         },
         {
             nameof(DeleteSpecificationAsync),
             x => DeleteSpecificationAsync((int)x.Arguments[0], (int)x.Arguments[1])
         },
         {
             nameof(GetSingleSpecificationAsync),
             x => GetSingleSpecificationAsync((int)x.Arguments[0], (int)x.Arguments[1])
         }
     });
 }
Esempio n. 2
0
        public EventServiceModelInterceptor(EventServiceModelValidator serviceValidator, ServiceTypeValidator serviceTypeValidator)
        {
            _serviceValidator     = serviceValidator;
            _serviceTypeValidator = serviceTypeValidator;

            BuildUp(new Dictionary <string, Action <IInvocation> >
            {
                {
                    nameof(GetServiceByIdAsync),
                    x => GetServiceByIdAsync((int)x.Arguments[0])
                },
                {
                    nameof(CreateEventServiceModelAsync),
                    x => CreateEventServiceModelAsync((EventServiceModel)x.Arguments[0])
                },
                {
                    nameof(UpdateEventServiceModelAsync),
                    x => UpdateEventServiceModelAsync((EventServiceModel)x.Arguments[0])
                },
                {
                    nameof(DeleteEventServiceModelAsync),
                    x => DeleteEventServiceModelAsync((int)x.Arguments[0])
                },
                {
                    nameof(GetServiceByTypeIdAsync),
                    x => GetServiceByTypeIdAsync((int)x.Arguments[0])
                }
            });
        }