public void DuplexSample(List <string> lista) { if (lista == null) { throw new ArgumentNullException(); } NetTcpBinding binding = new NetTcpBinding(); EndpointAddress address = new EndpointAddress("net.tcp://localhost:10104/IInsertCulculationFunction"); var clientCallback = new UpisiCallback2(); var context = new InstanceContext(clientCallback); var factory = new DuplexChannelFactory <IInsertCulculationFunction>(clientCallback, binding, address); IInsertCulculationFunction messageChanel = factory.CreateChannel(); Task.Run(() => messageChanel.PosaljiInsert(lista)); }
private static void DuplexSample(List <string> lista) { //"INSERT INTO UneseneVrednosti " + //"(IDGeoPodrucja, VremeMerenja, Vrednost) " + //"VALUES ('" + idGeoPodrucja + "', '" + datum + "', " + _unesenaPotrosnja + ")"; // string s = "INSERT INTO UneseneVrednosti(IDGeoPodrucja, VremeMerenja, Vrednost) VALUES ('DO', '2018-6-1 00:30:00.000', 234)"; var binding = new NetTcpBinding(); var address = new EndpointAddress("net.tcp://localhost:10104/IInsertCulculationFunction"); var clientCallback = new UpisiCallback2(); var context = new InstanceContext(clientCallback); var factory = new DuplexChannelFactory <IInsertCulculationFunction>(clientCallback, binding, address); IInsertCulculationFunction messageChanel = factory.CreateChannel(); Task.Run(() => messageChanel.PosaljiInsert(lista)); }