public VersoMsg ExecuteServiceBlock(VersoMsg verso) { var versoRes = new VersoMsg(); if(ConfigRepository.ServiceBlocks.ContainsKey(verso.ServiceBlock)) { var serviceBlock = ConfigRepository.ServiceBlocks[verso.ServiceBlock]; object res; if (serviceBlock.IsGeneric && ConfigRepository.ServiceTypes.ContainsKey(verso.TypeVerso.AssemblyName)) { var tGenService = ConfigRepository.ServiceTypes[verso.TypeVerso.AssemblyName] .GetType(verso.TypeVerso.ClassName); res = verso.Execute(Injector.InjectService(verso.ServiceBlock, tGenService), tGenService); } else { res = verso.Execute(Injector.InjectService(verso.ServiceBlock), null); } versoRes.DataVerso = res; } return versoRes; }
public VersoMsg ExecuteServiceBlock(VersoMsg verso) { var versoRes = new VersoMsg(); if (ConfigRepository.ServiceBlocks.ContainsKey(verso.ServiceBlock)) { var serviceBlock = ConfigRepository.ServiceBlocks[verso.ServiceBlock]; object res; if (serviceBlock.IsGeneric && ConfigRepository.ServiceTypes.ContainsKey(verso.TypeVerso.AssemblyName)) { var tGenService = ConfigRepository.ServiceTypes[verso.TypeVerso.AssemblyName] .GetType(verso.TypeVerso.ClassName); res = verso.Execute(Injector.InjectService(verso.ServiceBlock, tGenService), tGenService); } else { res = verso.Execute(Injector.InjectService(verso.ServiceBlock), null); } versoRes.DataVerso = res; } return(versoRes); }
public virtual VersoMsg GetVerso(Enum verb) { var verso = new VersoMsg(); verso.ServiceBlock = ServiceBlockName; verso.Verb = verb.ToString(); return(verso); }
public virtual VersoMsg GetVerso <T>(Enum verb, object dataVerso) { var verso = new VersoMsg(); verso.ServiceBlock = ServiceBlockName; verso.Verb = verb.ToString(); verso.SetData <T>(dataVerso); return(verso); }
public static VersoMsg ExecuteServiceBlock(VersoMsg verso) { var res = new VersoMsg(); var httpBind = new BasicHttpBinding(); httpBind.ReaderQuotas.MaxArrayLength = 2147483647; httpBind.ReaderQuotas.MaxStringContentLength = 2147483647; httpBind.ReaderQuotas.MaxNameTableCharCount = 2147483647; using (var octoSvc = new OctopusSvc.ServiceBlockClient(httpBind, new EndpointAddress(new Uri(OctoEndPoint)))) { var verProxy = new OctopusSvc.Verso(); verProxy.DataVersoExtension = verso.DataVersoExtension; verProxy.ServiceBlock = verso.ServiceBlock; verProxy.TypeVerso = new OctopusSvc.ServiceTypeGeneric { AssemblyName = verso.TypeVerso.AssemblyName, ClassName = verso.TypeVerso.ClassName }; verProxy.Verb = verso.Verb; var resProxy = octoSvc.ExecuteServiceBlock(verProxy); res.DataVersoExtension = resProxy.DataVersoExtension; res.ServiceBlock = resProxy.ServiceBlock; res.TypeVerso = new ServiceTypeGeneric { AssemblyName = resProxy.TypeVerso.AssemblyName, ClassName = resProxy.TypeVerso.ClassName }; res.Verb = resProxy.Verb; } return(res); }