public static void ServiceContract_TypedProxy_SyncOperation_UniqueTypeRefArg() { string message = "Hello"; BasicHttpBinding binding = null; ChannelFactory <IServiceContractUniqueTypeRefSyncService> factory = null; IServiceContractUniqueTypeRefSyncService serviceProxy = null; UniqueType uniqueType = new UniqueType(); try { // *** SETUP *** \\ binding = new BasicHttpBinding(); factory = new ChannelFactory <IServiceContractUniqueTypeRefSyncService>(binding, new EndpointAddress(Endpoints.ServiceContractSyncUniqueTypeRef_Address)); serviceProxy = factory.CreateChannel(); // *** EXECUTE *** \\ serviceProxy.Request(message, ref uniqueType); // *** VALIDATE *** \\ Assert.True((uniqueType.stringValue == message), String.Format("The value of the 'stringValue' field in the UniqueType instance was not as expected. expected {0} but got {1}", message, uniqueType.stringValue)); // *** CLEANUP *** \\ ((ICommunicationObject)serviceProxy).Close(); factory.Close(); } finally { // *** ENSURE CLEANUP *** \\ ScenarioTestHelpers.CloseCommunicationObjects((ICommunicationObject)serviceProxy, factory); } }
public QuickLinkNavigate(string columnName, object value, UniqueType unique = UniqueType.Single, object queryName = null) : this(new UniqueOptions(queryName ?? typeof(T)) { UniqueType = unique, FilterOptions = new List <FilterOption>() { new FilterOption(columnName, value) } }) { }
public static Lite <T> QueryUnique <T>(string columnName, object value, UniqueType uniqueType) where T : class, IEntity { return((Lite <T>) new UniqueOptions(typeof(T)) { UniqueType = uniqueType, FilterOptions = new List <FilterOption>() { new FilterOption(columnName, value) } }.ToRequest().QueryUnique()); }
public static Unique getUniqueTypeInfo(UniqueType type) { switch (type) { case UniqueType.WRONGWORLD_ROOTS: return(new Unique( "Wrongworld Roots", "Augotchi/Image/UIUnique/Wrongworldroot", UniqueType.WRONGWORLD_ROOTS, 500 )); } return(null); }
public static T Unique <T>(this IEnumerable <T> collection, UniqueType uniqueType) { switch (uniqueType) { case UniqueType.First: return(collection.FirstEx()); case UniqueType.FirstOrDefault: return(collection.FirstOrDefault()); case UniqueType.Single: return(collection.SingleEx()); case UniqueType.SingleOrDefault: return(collection.SingleOrDefaultEx()); case UniqueType.SingleOrMany: return(collection.SingleOrMany()); case UniqueType.Only: return(collection.Only()); default: throw new InvalidOperationException(); } }
public static void ServiceContract_TypedProxy_AsyncEndOperation_UniqueTypeOutArg() { string message = "Hello"; BasicHttpBinding binding = null; ChannelFactory <IServiceContractUniqueTypeOutService> factory = null; IServiceContractUniqueTypeOutService serviceProxy = null; UniqueType uniqueType = null; try { // *** SETUP *** \\ binding = new BasicHttpBinding(); factory = new ChannelFactory <IServiceContractUniqueTypeOutService>(binding, new EndpointAddress(Endpoints.ServiceContractAsyncUniqueTypeOut_Address)); serviceProxy = factory.CreateChannel(); ManualResetEvent waitEvent = new ManualResetEvent(false); // *** EXECUTE *** \\ // This delegate will execute when the call has completed, which is how we get the result of the call. AsyncCallback callback = (iar) => { serviceProxy.EndRequest(out uniqueType, iar); waitEvent.Set(); }; IAsyncResult ar = serviceProxy.BeginRequest(message, callback, null); // *** VALIDATE *** \\ Assert.True(waitEvent.WaitOne(ScenarioTestHelpers.TestTimeout), "AsyncCallback was not called."); Assert.True((uniqueType.stringValue == message), String.Format("The 'stringValue' field in the instance of 'UniqueType' was not as expected. expected {0} but got {1}", message, uniqueType.stringValue)); // *** CLEANUP *** \\ ((ICommunicationObject)serviceProxy).Close(); factory.Close(); } finally { // *** ENSURE CLEANUP *** \\ ScenarioTestHelpers.CloseCommunicationObjects((ICommunicationObject)serviceProxy, factory); } }
public QuickLinkNavigate(string columnName, Func <object> valueFactory, UniqueType unique = UniqueType.Single, object queryName = null) : this(columnName, (object)valueFactory, unique, queryName) { }
public void Request(string stringRequest, ref UniqueType uniqueTypeResponse) { uniqueTypeResponse.stringValue = stringRequest; }
public void Request(string stringRequest, out UniqueType uniqueTypeResponse) { uniqueTypeResponse = new UniqueType(); uniqueTypeResponse.stringValue = stringRequest; }
public static void ServiceContract_TypedProxy_SyncOperation_UniqueTypeRefArg() { string message = "Hello"; BasicHttpBinding binding = null; ChannelFactory<IServiceContractUniqueTypeRefSyncService> factory = null; IServiceContractUniqueTypeRefSyncService serviceProxy = null; UniqueType uniqueType = new UniqueType(); try { // *** SETUP *** \\ binding = new BasicHttpBinding(); factory = new ChannelFactory<IServiceContractUniqueTypeRefSyncService>(binding, new EndpointAddress(Endpoints.ServiceContractSyncUniqueTypeRef_Address)); serviceProxy = factory.CreateChannel(); // *** EXECUTE *** \\ serviceProxy.Request(message, ref uniqueType); // *** VALIDATE *** \\ Assert.True((uniqueType.stringValue == message), String.Format("The value of the 'stringValue' field in the UniqueType instance was not as expected. expected {0} but got {1}", message, uniqueType.stringValue)); // *** CLEANUP *** \\ ((ICommunicationObject)serviceProxy).Close(); factory.Close(); } finally { // *** ENSURE CLEANUP *** \\ ScenarioTestHelpers.CloseCommunicationObjects((ICommunicationObject)serviceProxy, factory); } }
public void Request(string stringRequest, ref UniqueType uniqueTypeResponse) { uniqueTypeResponse.stringValue = stringRequest; }
public void Request(string stringRequest, out UniqueType uniqueTypeResponse) { uniqueTypeResponse = new UniqueType(); uniqueTypeResponse.stringValue = stringRequest; }