public bool InitializeApplication(XafApplication winApplication, EndpointAddress endpointAddress, Binding binding) { System.Net.ServicePointManager.Expect100Continue = false; var clientDataServer = new OptimizedSecuredDataServerClient(binding, endpointAddress); ServerSecurityClient.CanUseCache = true; var securityClient = CreateServerSecurityClient(clientDataServer); securityClient.IsSupportChangePassword = true; XafDataContractResolver.AddToEndpoint(clientDataServer.ChannelFactory.Endpoint); winApplication.CreateCustomObjectSpaceProvider += (sender, e) => { XafApplication application = (XafApplication)sender; e.ObjectSpaceProviders.Add(CreateObjectSpaceProvider(clientDataServer, securityClient)); e.ObjectSpaceProviders.Add(CreateNonPersistentObjectSpaceProvider(application)); }; winApplication.Security = securityClient; if (DatabaseUpdateMode != DatabaseUpdateHandlerMode.None) { winApplication.DatabaseVersionMismatch += Application_DatabaseVersionMismatch; } return(true); }
protected virtual void ConfigureEndpoint(ServiceEndpoint endpoint) { XafDataContractResolver.AddToEndpoint(endpoint); }