Example #1
0
 public RpcService(string sNamespace, RpcServicePair hPair, Type hInterface, IServiceAttribute hAttribute, string sNamespaceSuffix)
 {
     Name        = hAttribute.Name;
     Pair        = hPair;
     Interface   = hInterface;
     Attribute   = hAttribute;
     Namespace   = sNamespace;
 }
Example #2
0
        public RpcServicePair(string sServerNamespace, string sClientNamespace, IServiceAttribute hServerAttrib, IServiceAttribute hClientAttrib)
        {
            Server      = new RpcService(sServerNamespace, this, hClientAttrib.Service, hServerAttrib, ".Service");
            Client      = new RpcService(sClientNamespace, this, hServerAttrib.Service, hClientAttrib, ".Protocol");
            Client.Generate();
            Server.Generate();

            SharedCode  = new List<string>();
            SharedCode.AddRange(Server.Rpcs.Select(hM => hM.Request.Code));
            SharedCode.AddRange(Server.Rpcs.Where(hM  => hM.Response != null).Select(hM => hM.Response.Code));
            SharedCode.AddRange(Server.Rpcs.Where(hM  => hM.ResponseAction != null).Select(hM => hM.ResponseAction.Code));

            SharedCode.AddRange(Client.Rpcs.Select(hM => hM.Request.Code));
            SharedCode.AddRange(Client.Rpcs.Where(hM => hM.Response != null).Select(hM => hM.Response.Code));
            SharedCode.AddRange(Client.Rpcs.Select(hM => hM.RequestAction.Code));
            SharedCode.Add(new ClientSessionCodeGen(Client).Code);
            SharedCode.Add(new NonBlockingClientSessionCodeGen(Client).Code);

            ServiceCode = new List<string>();
            ServiceCode.AddRange(Server.Rpcs.Select(hM => hM.RequestAction.Code));
            ServiceCode.AddRange(Client.Rpcs.Where(hM => hM.ResponseAction != null).Select(hM => hM.ResponseAction.Code));
            ServiceCode.Add(new ServerCodeGen(Server).Code);
            ServiceCode.Add(new ServerSessionCodeGen(Server).Code);
        }
Example #3
0
 private static void AddService(IServiceCollection services, Type service, IServiceAttribute attribute)
 {
     if (attribute.Factory is { } || attribute.UseAutoImplementedFactory)