/// <summary>
        /// Gets the service host types.
        /// </summary>
        /// <returns></returns>
        public IList <ServiceHostType> GetServiceHostTypes()
        {
            var list = new List <ServiceHostType>();

            using (var conn = new SqlConnection(WcfServiceHelper.GetConfigurationConnectionString()))
            {
                conn.Open();

                var context = new StoredProceduresDataContext(conn);
                var results = context.sp_GetAllServiceHostTypes();

                foreach (var result in results)
                {
                    var item = new ServiceHostType
                    {
                        ClassName    = result.ServiceHostTypeClassName,
                        FriendlyName = result.ServiceHostTypeFriendlyName,
                        Type_id      = result.ServiceHostType_id
                    };
                    list.Add(item);
                }

                conn.Close();
                conn.Dispose();
            }

            return(list);
        }
Exemplo n.º 2
0
 public void set(ServiceHostType svchostType, Type service_type)
 {
     _svc_hosts_type = svchostType;
     wcf_service = service_type;
     get_interface();
     _load_host_type();
 }
Exemplo n.º 3
0
 public void set(ServiceHostType svchostType, Type service_type)
 {
     _svc_hosts_type = svchostType;
     wcf_service     = service_type;
     get_interface();
     _load_host_type();
 }
Exemplo n.º 4
0
        private static ServiceHost GetServiceHost(ServiceHostType selectedServiceHostType)
        {
            Type serviceHostType;

            switch (selectedServiceHostType)
            {
                case ServiceHostType.Categories:
                    serviceHostType = typeof(CategoriesService);
                    break;
                default:
                    serviceHostType = typeof(OrdersService);
                    break;
            }

            return new ServiceHost(serviceHostType);
        }
Exemplo n.º 5
0
 public WCFServiceHostLoader()
 {
     _svc_hosts_type = ServiceHostType.soap;
 }
Exemplo n.º 6
0
 public WCFServiceHostLoader()
 {
     _svc_hosts_type = ServiceHostType.soap;
 }
Exemplo n.º 7
0
 public object SetHostType(ServiceHostType hosttype, Func <object> startmethod)
 {
     _host_type = hosttype;
     _wcf_host.set(_host_type, typeof(T));
     return(startmethod());
 }