예제 #1
0
        public IChannelFactory GetChannelFactory(IChannelDefinition definition)
        {
            IChannelFactory factory;

            if (!ChannelFactories.TryGetValue(definition.ChannelType, out factory))
            {
                factory = Assimilate.GetInstanceOf(definition.FactoryType) as IChannelFactory;
                ChannelFactories.TryAdd(definition.FactoryType,
                                        factory);
            }
            return(factory);
        }
예제 #2
0
        public override MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, out int totalRecords)
        {
            IMembershipService proxy = ChannelFactories.GetFactory <IMembershipService>(this.EndpointName).CreateChannel();

            try
            {
                MembershipUserCollection users = proxy.GetAllUsers(pageIndex, pageSize, out totalRecords);
                (proxy as ICommunicationObject).Close();
                return(users);
            }
            catch (Exception ex)
            {
                OperationInvoker.HandleException(ex, proxy as ICommunicationObject);
                throw;
            }
        }
예제 #3
0
        public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
        {
            IMembershipService proxy = ChannelFactories.GetFactory <IMembershipService>(this.EndpointName).CreateChannel();

            try
            {
                MembershipUser user = proxy.CreateUser(username, password, email, passwordQuestion, passwordAnswer, isApproved, providerUserKey, out status);
                (proxy as ICommunicationObject).Close();
                return(user);
            }
            catch (Exception ex)
            {
                OperationInvoker.HandleException(ex, proxy as ICommunicationObject);
                throw;
            }
        }