예제 #1
0
        public static async Task InitializeAsync(this IHttpOptionRepository rep)
        {
            //Если есть хотя бы 1 элемент то НЕ иннициализировать
            if (await rep.CountAsync(option => true) > 0)
            {
                return;
            }

            // var httpList = new List<HttpOption>
            // {
            //     new HttpOption
            //     {
            //         Id= 1,
            //         Name= "Http table 1",
            //         Address= "http://Google.com",
            //         AutoStart= true,
            //         Headers = new Dictionary<string, string>
            //         {
            //             {"heaeder 1", "value 1"},
            //             {"heaeder 2", "value 2"}
            //         }
            //     }
            // };

            //await rep.AddRangeAsync(httpList);
        }
예제 #2
0
 public MediatorForOptions(IDeviceOptionRepository deviceOptionRep,
                           IExchangeOptionRepository exchangeOptionRep,
                           ISerialPortOptionRepository serialPortOptionRep,
                           ITcpIpOptionRepository tcpIpOptionRep,
                           IHttpOptionRepository httpOptionRep)
 {
     _deviceOptionRep     = deviceOptionRep;
     _exchangeOptionRep   = exchangeOptionRep;
     _serialPortOptionRep = serialPortOptionRep;
     _tcpIpOptionRep      = tcpIpOptionRep;
     _httpOptionRep       = httpOptionRep;
 }