private ServiceInfoCollection FilterServiceProjections(ServiceInfoCollection serviceInfos, string businessKey) { // // If we are given an empty businessKey, just return the original collection. Without a businessKey, there is // no way to determine if these services are service projections or not. // if (null == businessKey || 0 == businessKey.Length) { return(serviceInfos); } // // Make a copy because manipulating the collection as you iterate over it is not a good idea. Accessing // a collection by index and removing items is probably very slow. Since we don't know how this collection // is implemented, making a copy and populating it is probably the safest thing to do from a performance standpoint. // ServiceInfoCollection filteredCollection = new ServiceInfoCollection(); foreach (ServiceInfo serviceInfo in serviceInfos) { // // If these business keys are equal, it is not a service projection, so // add it to our filtered list, otherwise, don't add it. // if (true == serviceInfo.BusinessKey.Equals(businessKey)) { filteredCollection.Add(serviceInfo); } } return(filteredCollection); }
public void AppTests_ServiceInfo_Created_Correctly() { ServiceInfoCollection coll = new ServiceInfoCollection(new[] { typeof(IWagenSomeGuestService), typeof(IWagenSomeUserService) }); ServiceInfo si; string[] operationNames; string[] expectedOperationNames; si = coll.GetServiceInfo(typeof(IWagenSomeGuestService).FullName); operationNames = si.GetOperationNames().OrderBy(s => s).ToArray(); expectedOperationNames = new [] { "AuthenticateBuddy", }; CollectionAssert.AreEqual(expectedOperationNames, operationNames); si = coll.GetServiceInfo(typeof(IWagenSomeUserService).FullName); operationNames = si.GetOperationNames().OrderBy(s => s).ToArray(); expectedOperationNames = new[] { "ChangePassword", "CreateProject", "GetOnlineSessions", "GetSession", "GetStoredSessions", "SignOut", }; CollectionAssert.AreEqual(expectedOperationNames, operationNames); }
public ApplicationInfo() { Services = new ServiceInfoCollection(this); Models = new ModelInfoCollection(this); UserInterfaces = new UserInterfaceInfoCollection(this); Enumerations = new EnumerationInfoCollection(this); Databases = new DatabaseInfoCollection(this); }
public static ServiceInfoCollection GetServiceInfos(this IAppProvider appProvider) { ServiceInfoCollection coll = new ServiceInfoCollection(appProvider .EnumerateServiceNames() .Select(name => appProvider.GetBinding(name).ServiceType) .ToArray()); return coll; }
public ProtobufSerializer(ServiceInfoCollection serviceInfos) { // todo1[ak] check args _serviceInfos = serviceInfos; }