//SortedDictionary<Guid, Column> columns = new SortedDictionary<Guid, Column> (); ServiceAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, ServiceParameters parameters) : base(serviceAgentMode, objectBusSession, flush, false) { if (serviceAgentMode != ServiceAgentMode.Server) throw new Exception ("This service agent can only be run in server mode."); conn = new SqliteConnection (parameters.ConnectionString); objectBusSession.RegisterType (typeof(GetTablesRequestMessage), GetTablesRequestMessageReceived); objectBusSession.RegisterType (typeof(GetColumnsRequestMessage), GetColumnsRequestMessageReceived); objectBusSession.RegisterType (typeof(GetRowsRequestMessage), GetRowsRequestMessageReceived); objectBusSession.RegisterType (typeof(GetForeignKeyRelationsRequestMessage), GetForeignKeyRelationsRequestMessageReceived); }
public static ServiceAgent CreateAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, byte[] parameters) { return(new ServiceAgent(serviceAgentMode, objectBusSession, flush, ServiceParameters.Deserialize(parameters))); }
//SortedDictionary<Guid, Column> columns = new SortedDictionary<Guid, Column> (); ServiceAgent(ServiceAgentMode serviceAgentMode, ObjectBusSession objectBusSession, Action flush, ServiceParameters parameters) : base(serviceAgentMode, objectBusSession, flush, false) { if (serviceAgentMode != ServiceAgentMode.Server) { throw new Exception("This service agent can only be run in server mode."); } conn = new SqliteConnection(parameters.ConnectionString); objectBusSession.RegisterType(typeof(GetTablesRequestMessage), GetTablesRequestMessageReceived); objectBusSession.RegisterType(typeof(GetColumnsRequestMessage), GetColumnsRequestMessageReceived); objectBusSession.RegisterType(typeof(GetRowsRequestMessage), GetRowsRequestMessageReceived); objectBusSession.RegisterType(typeof(GetForeignKeyRelationsRequestMessage), GetForeignKeyRelationsRequestMessageReceived); }