Esempio n. 1
0
 protected virtual ISynchChannel <T1, T2 /*, ItemMatch<T1, T2>*/> DoCreate <TId>(
     IChannelConfiguration <T1, T2, TId, ItemMatch <T1, T2> > config,
     IPlumber <T1, T2, TId> plumber)
     where TId : IEquatable <TId>
 {
     return(new OneWayPullChannel <T1, T2, TId, ItemMatch <T1, T2> >(config, plumber, ListProvider1, ListProvider2));
 }
Esempio n. 2
0
        public static void AddViewsEngine(this IPlumber plumber, Action <IViewsEngineSettings> viewsEngineSettings)
        {
            var settings = new BaseViewsEngineSettings();

            viewsEngineSettings.Invoke(settings);

            AddDependencies(plumber.Services, settings);
        }
Esempio n. 3
0
        public ISynchChannel <T1, T2 /*, ItemMatch<T1, T2>*/> Create <TId>(
            IChannelConfiguration <T1, T2, TId, ItemMatch <T1, T2> > config,
            IPlumber <T1, T2, TId> plumber)
            where TId : IEquatable <TId>
        {
            var channel = DoCreate(config, plumber);

            foreach (var channelCreationObserver in CreationObservers)
            {
                channelCreationObserver.Created(channel);
            }

            return(channel);
        }
Esempio n. 4
0
        public static void AddDatabase <T>(this IPlumber plumber, string connectionString = null, DatabaseType databaseType = DatabaseType.MsSql, string migrationsAssembly = null) where T : PipeworksContext <T>
        {
            if (migrationsAssembly == null)
            {
                migrationsAssembly = typeof(T).Assembly.FullName;
            }

            switch (databaseType)
            {
            case DatabaseType.MsSql:

            {
                plumber.Services.AddDbContext <T>(options => options.UseSqlServer(
                                                      connectionString ?? plumber.ConnectionString,
                                                      b => b.MigrationsAssembly(migrationsAssembly)));
                break;
            }
            }
        }
Esempio n. 5
0
        public OneWayPullChannel(
            [NotNull] ISynchSourcesConfig <T1, T2, TId> channelConfig,
            [NotNull] IPlumber <T1, T2, TId> plumber,
            [NotNull] Func <Task <IEnumerable <T1> > > t1DataSource,
            [NotNull] Func <Task <IEnumerable <T2> > > t2DataSource)
        {
            if (plumber == null)
            {
                throw new ArgumentNullException(nameof(plumber));
            }
            if (t1DataSource == null)
            {
                throw new ArgumentNullException(nameof(t1DataSource));
            }
            if (t2DataSource == null)
            {
                throw new ArgumentNullException(nameof(t2DataSource));
            }

            ChannelConfig = channelConfig;
            Plumber       = plumber;
            _t1DataSource = t1DataSource;
            _t2DataSource = t2DataSource;
        }
Esempio n. 6
0
 public static void AddHttpCommunication(this IPlumber plumber)
 {
 }
Esempio n. 7
0
 public void Configure <T1, T2, TId, TSynch>(IPlumber <T1, T2, TId> bla)
     where TId : IEquatable <TId>
 {
     // Set the preprocessor?
     // Set the rules?
 }
Esempio n. 8
0
 internal static void Apply(this IPlumber plumber, Action <IPlumber> plumberAction)
 {
     plumberAction.Invoke(plumber);
 }
Esempio n. 9
0
 public static void AddSettings(this IPlumber plumber)
 {
     plumber.AddDatabase <SiteSettingsContext>();
 }