コード例 #1
0
 public void Complex()
 {
     var context = TestExecuter.GetContext();
     var builder = SequenceBuilder.Fluent
                   .ReadFrom(TestData.Person(context))
                   .ExpandFromLookup(new ExpandFromLookupMutator(context)
     {
         LookupBuilder = new RowLookupBuilder()
         {
             Process      = TestData.Country(context),
             KeyGenerator = row => row.GenerateKey("id"),
         },
         MatchSelector = (row, lookup) =>
         {
             return(lookup.GetSingleRowByKey(row.GenerateKey("countryId")));
         },
         NoMatchAction = new NoMatchAction(MatchMode.Custom)
         {
             CustomAction = row =>
             {
                 row["countryAbbrev"] = !row.HasValue("countryId")
                         ? "country was null"
                         : "no match found";
             }
         },
         MatchCustomAction = (row, match) => row["countryAbbrevFound"] = true,
         Columns           = new()
         {
コード例 #2
0
 public void NoMatchCustom()
 {
     var context            = TestExecuter.GetContext();
     var executedBatchCount = 0;
     var builder            = ProcessBuilder.Fluent
                              .ReadFrom(TestData.Person(context))
                              .JoinBatched(new BatchedJoinMutator(context)
     {
         BatchSize     = 4,
         LookupBuilder = new FilteredRowLookupBuilder()
         {
             ProcessCreator = filterRows =>
             {
                 executedBatchCount++;
                 return(TestData.PersonEyeColor(context));
             },
             KeyGenerator = row => row.GenerateKey("personId"),
         },
         RowKeyGenerator = row => row.GenerateKey("id"),
         NoMatchAction   = new NoMatchAction(MatchMode.Custom)
         {
             CustomAction = row => row["eyeColor"] = "not found",
         },
         Columns = new()
         {
コード例 #3
0
 public void DummyForDevelopment3()
 {
     var context = TestExecuter.GetContext();
     var builder = ProcessBuilder.Fluent
                   .ReadFrom(TestData.Person(context))
                   .Join(new JoinMutator(context)
     {
         LookupBuilder = new RowLookupBuilder()
         {
             Process      = TestData.PersonEyeColor(context),
             KeyGenerator = row => row.GenerateKey("personId"),
         },
         RowKeyGenerator = row => row.GenerateKey("id"),
         NoMatchAction   = new NoMatchAction(MatchMode.Throw),
         Columns         = new(),
     });
コード例 #4
0
 public void NoMatchCustom()
 {
     var context = TestExecuter.GetContext();
     var builder = ProcessBuilder.Fluent
                   .ReadFrom(TestData.Person(context))
                   .Join(new JoinMutator(context)
     {
         LookupBuilder = new RowLookupBuilder()
         {
             Process      = TestData.PersonEyeColor(context),
             KeyGenerator = row => row.GenerateKey("personId"),
         },
         RowKeyGenerator = row => row.GenerateKey("id"),
         NoMatchAction   = new NoMatchAction(MatchMode.Custom)
         {
             CustomAction = row => row["eyeColor"] = "not found",
         },
         Columns = new()
         {
コード例 #5
0
        private void Initalize()
        {
            UrlMappingConfig config = UrlMappingConfig.Instance;

            _provider = ServiceLocator.Instance.Resolve <IUrlMappingProvider>();

            _noMatchAction                 = config.NoMatchAction;
            _noMatchRedirectPage           = config.NoMatchRedirectUrl;
            _automaticallyUpdateFormAction = config.AutoUpdateFormAction;
            _qsBehavior      = config.IncomingQueryStringBehavior;
            _processingEvent = config.UrlProcessingEvent;

            if (_provider != null)
            {
                _provider.Initialize(config);
            }

            // save to config
            config.Provider = _provider;
        }
コード例 #6
0
        private void Initalize()
        {
            UrlMappingConfig config = UrlMappingConfig.Instance;

            _provider = ServiceLocator.Instance.Resolve<IUrlMappingProvider>();

            _noMatchAction = config.NoMatchAction;
            _noMatchRedirectPage = config.NoMatchRedirectUrl;
            _automaticallyUpdateFormAction = config.AutoUpdateFormAction;
            _qsBehavior = config.IncomingQueryStringBehavior;
            _processingEvent = config.UrlProcessingEvent;

            if (_provider != null)
            {
                _provider.Initialize(config);
            }

            // save to config
            config.Provider = _provider;
        }