public static FeatureMappingFilter FromFeatureMappingParameters(FeatureMappingParameters parameters)
 {
     return new FeatureMappingFilter()
     {
         FeatureMappingId = parameters.FeatureMappingId,
         Action = parameters.Action
     };
 }
 public static FdpFeatureMapping FromParameters(FeatureMappingParameters parameters)
 {
     return new FdpFeatureMapping()
     {
         FdpFeatureMappingId = parameters.FeatureMappingId,
         ProgrammeId = parameters.ProgrammeId,
         Gateway = parameters.Gateway
     };
 }
 public new static OxoFeature FromParameters(FeatureMappingParameters parameters)
 {
     return new OxoFeature
     {
         FeatureId = parameters.FeatureId,
         FeaturePackId = parameters.FeaturePackId,
         DocumentId = parameters.DocumentId,
         FeatureCode = parameters.FeatureCode
     };
 }
        protected override bool IsValid(PropertyValidatorContext context)
        {
            Parameters = context.ParentContext.InstanceToValidate as FeatureMappingParameters;

            var filter = FeatureMappingFilter.FromFeatureMappingParameters(Parameters);
            filter.PageSize = int.MaxValue;

            var oxoFeatures =
                _context.Vehicle.ListOxoFeatures(filter).Result;

            return
                !oxoFeatures.CurrentPage.Any(IsExistingFeatureCode);
        }
        protected override bool IsValid(PropertyValidatorContext context)
        {
            Parameters = context.ParentContext.InstanceToValidate as FeatureMappingParameters;

            return Parameters.FeatureId.HasValue || Parameters.FeaturePackId.HasValue;
        }