// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Collections.Generic; using System.Runtime.Remoting; using Demo.Common; namespace Demo.Server { public class EmployeeService : MarshalByRefObject, IEmployeeService { public List GetAllEmployees() { List res = new List(); res.Add(new Employee { Id=1, Name="Dilbert", Job="Engineer" }); res.Add(new Employee { Id=2, Name="Wally", Job="Socalled engineer" }); res.Add(new Employee { Id=3, Name="PHB", Job="Boss" }); return res; } public Employee GetEmployeeById(int id) { return new Employee { Id=id, Name="Fusk", Job="Aner det ikke" }; } } public class ServerMain { public static void Main(string[] args) { RemotingConfiguration.Configure("Server.exe.config", true); Console.Write("Press enter to exit"); Console.ReadKey(); } } }