public ActionResult GetSubject() { NetTcpBinding binding = new NetTcpBinding(); ChannelFactory <IJobReader> factory = new ChannelFactory <IJobReader>(binding, new EndpointAddress("net.tcp://localhost:10101/InputRequest")); IJobReader proxy = factory.CreateChannel(); List <Subject> listaSub = new List <Subject>(); listaSub = proxy.ReadFromDatabase(); return(View(listaSub)); }
public ActionResult EditSubject(string RowKey) { NetTcpBinding binding = new NetTcpBinding(); ChannelFactory <IJobReader> factory = new ChannelFactory <IJobReader>(binding, new EndpointAddress("net.tcp://localhost:10101/InputRequest")); IJobReader proxy = factory.CreateChannel(); NetTcpBinding binding2 = new NetTcpBinding(); ChannelFactory <IJobLogger> factory2 = new ChannelFactory <IJobLogger>(binding, new EndpointAddress("net.tcp://localhost:10102/InputRequest")); IJobLogger proxy2 = factory2.CreateChannel(); List <Subject> listaSub = new List <Subject>(); listaSub = proxy.ReadFromDatabase(); Subject s = listaSub.Find(st => st.RowKey.Equals(RowKey)); ViewBag.Subject = s; return(View()); // return View("Edit",s); }