コード例 #1
0
        public PortalContext(OrganizationServiceContext context, RequestContext request, IWebsiteSelector websiteSelector)
        {
            Request          = request ?? GetRequestContext();
            ServiceContext   = context;
            _websiteSelector = websiteSelector;

            _website = new Lazy <Entity>(() => GetWebsite(ServiceContext, Request, _websiteSelector));
            _user    = new Lazy <Entity>(() => GetUser(ServiceContext, Request));
            _node    = new Lazy <CrmSiteMapNode>(() => GetNode(Request));
            _entity  = new Lazy <Entity>(() => GetEntity(ServiceContext, _node.Value));
        }
コード例 #2
0
        /// <summary>
        /// Initializes custom settings.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="config"></param>
        public virtual void Initialize(string name, NameValueCollection config)
        {
            var portalElement = PortalCrmConfigurationManager.GetPortalContextElement(name);

            _websiteSelector = portalElement.WebsiteSelector.CreateWebsiteSelector(portalElement.Name);

            var mergeOptionText = config["mergeOption"];

            if (!string.IsNullOrWhiteSpace(mergeOptionText))
            {
                ServiceContext.MergeOption = mergeOptionText.ToEnum <MergeOption>();
            }

            AttributeMapUsername = config["attributeMapUsername"];
            MemberEntityName     = config["memberEntityName"];
        }
コード例 #3
0
 private static Entity GetWebsite(OrganizationServiceContext context, RequestContext request, IWebsiteSelector websiteSelector)
 {
     return(websiteSelector.GetWebsite(context, request));
 }
コード例 #4
0
 public PortalContext(string contextName, RequestContext request, IWebsiteSelector websiteSelector)
     : this(CrmConfigurationManager.CreateContext(contextName), request, websiteSelector)
 {
 }