Click here to Skip to main content
15,879,326 members
Articles / Web Development

Service Based Membership Providers for ASP.NET

Rate me:
Please Sign up or sign in to vote.
4.93/5 (45 votes)
4 May 2014CPOL29 min read 131.3K   8.2K   173  
Service based, multi-application ASP.NET custom membership, role and profile providers with a hierarchical role system.
<html xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:mshelp="http://msdn.microsoft.com/mshelp"><head><link rel="SHORTCUT ICON" href="./../icons/favicon.ico" /><style type="text/css">.OH_CodeSnippetContainerTabLeftActive, .OH_CodeSnippetContainerTabLeft,.OH_CodeSnippetContainerTabLeftDisabled { backgroundImageName: tabLeftBG.gif; }.OH_CodeSnippetContainerTabRightActive, .OH_CodeSnippetContainerTabRight,.OH_CodeSnippetContainerTabRightDisabled { backgroundImageName: tabRightBG.gif; }.OH_footer { backgroundImageName: footer_slice.gif; background-position: top; background-repeat: repeat-x; }</style><link rel="stylesheet" type="text/css" href="./../styles/branding.css" /><link rel="stylesheet" type="text/css" href="./../styles/branding-en-US.css" /><style type="text/css">
			body
			{
			border-left:5px solid #e6e6e6;
			overflow-x:scroll;
			overflow-y:scroll;
			}
		</style><script src="./../scripts/branding.js" type="text/javascript"><!----></script><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>UserProfileTypeServiceProxy.EnqueueNewOrUpdateEntities Method </title><meta name="Language" content="en-us" /><meta name="System.Keywords" content="EnqueueNewOrUpdateEntities method" /><meta name="System.Keywords" content="UserProfileTypeServiceProxy.EnqueueNewOrUpdateEntities method" /><meta name="Microsoft.Help.F1" content="CryptoGateway.RDB.Data.AspNetMember.UserProfileTypeServiceProxy.EnqueueNewOrUpdateEntities" /><meta name="Microsoft.Help.Id" content="M:CryptoGateway.RDB.Data.AspNetMember.UserProfileTypeServiceProxy.EnqueueNewOrUpdateEntities(CryptoGateway.RDB.Data.AspNetMember.CallContext,CryptoGateway.RDB.Data.AspNetMember.UserProfileTypeSet,CryptoGateway.RDB.Data.AspNetMember.UserProfileType[])" /><meta name="Description" content="Queue a set of entities to be added or updated to the entity set in a certain preset future time." /><meta name="Microsoft.Help.ContentType" content="Reference" /><meta name="BrandingAware" content="'true'" /><meta name="container" content="CryptoGateway.RDB.Data.AspNetMember" /><meta name="file" content="32935912-5d98-cde4-8818-0b6e02270da2" /><meta name="guid" content="32935912-5d98-cde4-8818-0b6e02270da2" /><link type="text/css" rel="stylesheet" href="ms-help://Hx/HxRuntime/HxLink.css" /><meta name="SelfBranded" content="true" /></head><body onload="onLoad()" class="primary-mtps-offline-document"><div class="OH_outerDiv"><div class="OH_outerContent"><table class="TitleTable"><tr><td class="OH_tdTitleColumn">UserProfileTypeServiceProxy<span id="ID0EBBABAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EBBABAAA?vb=.|cpp=::|cs=.|fs=.|nu=.");
				</script>EnqueueNewOrUpdateEntities Method </td><td class="OH_tdRunningTitleColumn">Service Proxy API for Membership data sources</td></tr></table><div id="mainSection"><div id="mainBody"><span class="introStyle"></span><p style="color: #dc143c; font-size: 8.5pt; font-weight: bold;">[This is preliminary documentation and is subject to change.]</p><div class="summary">
              Queue a set of entities to be added or updated to the entity set in a certain preset future time. 
            </div><p></p><b>Namespace:</b> <a href="9b9992ae-86cf-af3e-5eb6-8fad208413c4.htm" target="">CryptoGateway.RDB.Data.AspNetMember</a><br /><b>Assembly:</b> <span sdata="assembly">AspNetMemberServiceProxy.Desktop</span> (in AspNetMemberServiceProxy.Desktop.dll) Version: 0.0.0.0<div class="OH_CollapsibleAreaRegion"><div class="OH_regiontitle">Syntax</div><div class="OH_CollapsibleArea_HrDiv"><hr class="OH_CollapsibleArea_Hr" /></div></div><div class="OH_clear"></div><div id="snippetGroup_Syntax" class="code"><div id="ID0EDHDAAAAA" class="OH_CodeSnippetContainer"><div class="OH_CodeSnippetContainerTabs" id="ID0EDHDAAAAA_tabs"><div class="OH_CodeSnippetContainerTabLeftActive" id="ID0EDHDAAAAA_tabimgleft"></div><div id="ID0EDHDAAAAA_tab1" class="OH_CodeSnippetContainerTabActive" EnableCopyCode="true"><a href="#" onclick="javascript:ChangeTab('ID0EDHDAAAAA','C#','1','4');return false;">C#</a></div><div id="ID0EDHDAAAAA_tab2" class="OH_CodeSnippetContainerTab" EnableCopyCode="true"><a href="#" onclick="javascript:ChangeTab('ID0EDHDAAAAA','Visual Basic','2','4');return false;">VB</a></div><div id="ID0EDHDAAAAA_tab3" class="OH_CodeSnippetContainerTab" EnableCopyCode="true"><a href="#" onclick="javascript:ChangeTab('ID0EDHDAAAAA','Visual C++','3','4');return false;">C++</a></div><div id="ID0EDHDAAAAA_tab4" class="OH_CodeSnippetContainerTab" EnableCopyCode="true"><a href="#" onclick="javascript:ChangeTab('ID0EDHDAAAAA','F#','4','4');return false;">F#</a></div><div class="OH_CodeSnippetContainerTabRight" id="ID0EDHDAAAAA_tabimgright"></div></div><div id="ID0EDHDAAAAA_codecollection" class="OH_CodeSnippetContainerCodeCollection"><div class="OH_CodeSnippetToolBar"><div class="OH_CodeSnippetToolBarText"><a id="ID0EDHDAAAAA_ViewColorized" href="#" onclick="javascript:ExchangeTitleContent('ID0EDHDAAAAA','4')" title="View Colorized" style="display: none">View Colorized</a><a id="ID0EDHDAAAAA_copycode" href="#" onclick="javascript:CopyToClipboard('ID0EDHDAAAAA','4')" title="Copy to Clipboard">Copy to Clipboard</a><a id="ID0EDHDAAAAA_PrintText" class="OH_PrintText" href="#" onclick="javascript:Print('ID0EDHDAAAAA','4')" title="Print">Print</a></div></div><div id="ID0EDHDAAAAA_code_Div1" class="OH_CodeSnippetContainerCode" style="display: block"><pre><span class="keyword">public</span> <span class="keyword">void</span> <span class="identifier">EnqueueNewOrUpdateEntities</span>(
	<span class="identifier">CallContext</span> <span class="parameter">cntx</span>,
	<span class="identifier">UserProfileTypeSet</span> <span class="parameter">set</span>,
	<span class="identifier">UserProfileType</span>[] <span class="parameter">entities</span>
)</pre></div><div id="ID0EDHDAAAAA_code_Plain_Div1" class="OH_CodeSnippetContainerCode" style="display: none"><pre>public void EnqueueNewOrUpdateEntities(
	CallContext cntx,
	UserProfileTypeSet set,
	UserProfileType[] entities
)</pre></div><div id="ID0EDHDAAAAA_code_Div2" class="OH_CodeSnippetContainerCode" style="display: none"><pre><span class="keyword">Public</span> <span class="keyword">Sub</span> <span class="identifier">EnqueueNewOrUpdateEntities</span> ( 
	<span class="parameter">cntx</span> <span class="keyword">As</span> <span class="identifier">CallContext</span>,
	<span class="parameter">set</span> <span class="keyword">As</span> <span class="identifier">UserProfileTypeSet</span>,
	<span class="parameter">entities</span> <span class="keyword">As</span> <span class="identifier">UserProfileType</span>()
)</pre></div><div id="ID0EDHDAAAAA_code_Plain_Div2" class="OH_CodeSnippetContainerCode" style="display: none"><pre>Public Sub EnqueueNewOrUpdateEntities ( 
	cntx As CallContext,
	set As UserProfileTypeSet,
	entities As UserProfileType()
)</pre></div><div id="ID0EDHDAAAAA_code_Div3" class="OH_CodeSnippetContainerCode" style="display: none"><pre><span class="keyword">public</span>:
<span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">EnqueueNewOrUpdateEntities</span>(
	<span class="identifier">CallContext</span>^ <span class="parameter">cntx</span>, 
	<span class="identifier">UserProfileTypeSet</span>^ <span class="parameter">set</span>, 
	<span class="keyword">array</span>&lt;<span class="identifier">UserProfileType</span>^&gt;^ <span class="parameter">entities</span>
) <span class="keyword">sealed</span></pre></div><div id="ID0EDHDAAAAA_code_Plain_Div3" class="OH_CodeSnippetContainerCode" style="display: none"><pre>public:
virtual void EnqueueNewOrUpdateEntities(
	CallContext^ cntx, 
	UserProfileTypeSet^ set, 
	array&lt;UserProfileType^&gt;^ entities
) sealed</pre></div><div id="ID0EDHDAAAAA_code_Div4" class="OH_CodeSnippetContainerCode" style="display: none"><pre><span class="keyword">abstract</span> <span class="identifier">EnqueueNewOrUpdateEntities</span> : 
        <span class="parameter">cntx</span> : <span class="identifier">CallContext</span> * 
        <span class="parameter">set</span> : <span class="identifier">UserProfileTypeSet</span> * 
        <span class="parameter">entities</span> : <span class="identifier">UserProfileType</span>[] <span class="keyword">-&gt;</span> <span class="keyword">unit</span> 
<span class="keyword">override</span> <span class="identifier">EnqueueNewOrUpdateEntities</span> : 
        <span class="parameter">cntx</span> : <span class="identifier">CallContext</span> * 
        <span class="parameter">set</span> : <span class="identifier">UserProfileTypeSet</span> * 
        <span class="parameter">entities</span> : <span class="identifier">UserProfileType</span>[] <span class="keyword">-&gt;</span> <span class="keyword">unit</span> </pre></div><div id="ID0EDHDAAAAA_code_Plain_Div4" class="OH_CodeSnippetContainerCode" style="display: none"><pre>abstract EnqueueNewOrUpdateEntities : 
        cntx : CallContext * 
        set : UserProfileTypeSet * 
        entities : UserProfileType[] -&gt; unit 
override EnqueueNewOrUpdateEntities : 
        cntx : CallContext * 
        set : UserProfileTypeSet * 
        entities : UserProfileType[] -&gt; unit </pre></div></div></div><script>addSpecificTextLanguageTagSet('ID0EDHDAAAAA');</script></div><div id="parameters"><h4 class="subHeading">Parameters</h4><dl paramName="cntx"><dt><span class="parameter">cntx</span></dt><dd>Type: <a href="1a3658b6-b213-9ff6-572e-f77262c032c5.htm" target="">CryptoGateway.RDB.Data.AspNetMember<span id="ID0EBCACGDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EBCACGDAAAAA?vb=.|cpp=::|cs=.|fs=.|nu=.");
				</script>CallContext</a><br /><span>Authenticated caller context object. If cannot be null.</span></dd></dl><dl paramName="set"><dt><span class="parameter">set</span></dt><dd>Type: <a href="2bb9d147-9460-cf6d-104b-64eadd11a193.htm" target="">CryptoGateway.RDB.Data.AspNetMember<span id="ID0EBCABGDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EBCABGDAAAAA?vb=.|cpp=::|cs=.|fs=.|nu=.");
				</script>UserProfileTypeSet</a><br /><span>The current entity set.</span></dd></dl><dl paramName="entities"><dt><span class="parameter">entities</span></dt><dd>Type: <span id="ID0EEAAGDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EEAAGDAAAAA?vb=|cpp=array&lt;|cs=|fs=|nu=");
				</script><a href="87fea96d-135b-3c16-00dc-161be36e807d.htm" target="">CryptoGateway.RDB.Data.AspNetMember<span id="ID0EBDAAGDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EBDAAGDAAAAA?vb=.|cpp=::|cs=.|fs=.|nu=.");
				</script>UserProfileType</a><span id="ID0ECAAGDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0ECAAGDAAAAA?vb=()|cpp=&gt;|cs=[]|fs=[]|nu=[]");
				</script><br /><span>The list of entities to be processed.</span></dd></dl></div><h4 class="subHeading">Return Value</h4>Type: <br /><h4 class="subHeading">Implements</h4><a href="c9976d11-262b-7d35-e0c8-74fcd640fccb.htm" target="">IUserProfileTypeService2<span id="ID0EFBDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EFBDAAAAA?vb=.|cpp=::|cs=.|fs=.|nu=.");
				</script>EnqueueNewOrUpdateEntities(CallContext, UserProfileTypeSet, <span id="ID0EDBDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EDBDAAAAA?vb=|cpp=array&lt;|cs=|fs=|nu=");
				</script>UserProfileType<span id="ID0EBBDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EBBDAAAAA?vb=()|cpp=&gt;|cs=[]|fs=[]|nu=[]");
				</script>)</a><br /><div class="OH_CollapsibleAreaRegion"><div class="OH_regiontitle">Remarks</div><div class="OH_CollapsibleArea_HrDiv"><hr class="OH_CollapsibleArea_Hr" /></div></div><div class="OH_clear"></div><p>
             The processing will be delayed to be started at a certain future time. If there are any further calls to this method during the wait period, the new sets will be 
             merged with existing ones inside the queue. This method is useful when there are repetitive updates to the entity set but the actual change history is not of 
             interest to the client, namely only the last snapshot of the changes are relevent. In this case, the method can reduce the loads on the backend data source 
             significantly.
             </p><p>
             The list of entities will be checked against existing ones inside the entity set when the processing starts. An entity is identified by a set of "intrinsic identitfiers" selected
             when the system is generated. They are not necessarily the same as primary keys of the set. An auto generated primary key can not be
             used as an "intrinsic identitfier". An entity having the same set of "intrinsic identitfiers" can not be added to the database. They will be treated 
             as an entity update if the client load the entity first before modifying it, otherwise (namely if the client created the entity on the client side), 
             the update will be rejected unless the client set the <span class="code">OverrideExisting</span> property  of "cntx" to <span class="code">true</span>. 
             </p><p>
             Note: entities having no "intrinsic identitfier" will always be treated as different entities in add or update operations, namely they will always be added to the set.
             </p><p>
             Note 2: A persisted entity (namely the one loaded
             from the data set) will be ignored in if none of its editable properties (set before system generation, see
             <a href="87fea96d-135b-3c16-00dc-161be36e807d.htm" target="">UserProfileType</a>) is modified or its <a href="ce3ae4df-ea6f-ccf2-e0cb-8a68616468d8.htm" target="">IsEntityChanged</a> property is
             not set to <span class="code">true</span>. 
             </p><p>
             Warning: Please do not use this method when new entities are to be added and information about these updated enitities, like auto generated primary keys, are needed for 
             proceeding to the next steps.
             </p><p>
             Clients can set some of the member entities in { <a href="766acd5d-0b77-2b16-2310-da1092c791c2.htm" target="">ChangedUserProfiles</a> } that an currently added or updated entity depends upon. These additional entities will be 
             add or updated to the data source following the same logic, all the object relationships will be properly setup if the operation is successful.
             </p><p>
             In general, a client can construct an object graph of any complexity following the above rules and have it added or updated to the data source in one step.
             </p><a name="seeAlsoSection"><!----></a><div class="OH_CollapsibleAreaRegion"><div class="OH_regiontitle">See Also</div><div class="OH_CollapsibleArea_HrDiv"><hr class="OH_CollapsibleArea_Hr" /></div></div><div class="OH_clear"></div><div class="seeAlsoStyle"><a href="a7abdf34-54d7-15a7-f6a2-3094da3bcb58.htm" target="">UserProfileTypeServiceProxy Class</a></div><div class="seeAlsoStyle"><a href="5c45e73a-e5e9-4d77-26fd-4ce6798dbd16.htm" target="">UserProfileTypeServiceProxy Members</a></div><div class="seeAlsoStyle"><a href="9b9992ae-86cf-af3e-5eb6-8fad208413c4.htm" target="">CryptoGateway.RDB.Data.AspNetMember Namespace</a></div></div></div></div></div><div id="OH_footer" class="OH_footer"><p /><div class="OH_feedbacklink"><a href="mailto:?subject=Service+Proxy+API+for+Membership+data+sources+UserProfileTypeServiceProxy.EnqueueNewOrUpdateEntities+Method++100+EN-US&amp;body=Your%20feedback%20is%20used%20to%20improve%20the%20documentation%20and%20the%20product.%20Your%20e-mail%20address%20will%20not%20be%20used%20for%20any%20other%20purpose%20and%20is%20disposed%20of%20after%20the%20issue%20you%20report%20is%20resolved.%20While%20working%20to%20resolve%20the%20issue%20that%20you%20report%2c%20you%20may%20be%20contacted%20via%20e-mail%20to%20get%20further%20details%20or%20clarification%20on%20the%20feedback%20you%20sent.%20After%20the%20issue%20you%20report%20has%20been%20addressed%2c%20you%20may%20receive%20an%20e-mail%20to%20let%20you%20know%20that%20your%20feedback%20has%20been%20addressed.">Send Feedback</a> on this topic.</div></div></body></html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Founder CryptoGateway Software Inc.
Canada Canada


His interests in software research and development include security, domain specific meta-language development technologies and tools, meta-language driven code generation, generation of non-invasive and virtual SQL database for "un-structured" data (sqlization), automated relational data service production technologies, file system sqlization technologies and products, structured multi-lingual documentation tools and technologies, sqlization of user's personal data, like emails, etc..


He was a physicist before year 2000. He studied theoretical physics (the hidden symmetry between the past and future, quantum field theories, mirror universe, cosmological dark energies etc.) in which he think to had made fundamental breakthroughs[^] but the community is either not ready for it or is actively rejecting/ignoring it Smile | :) .



It struck me on Apr. 11, 2023 that the said theory above can even generate General Relativity naturally after a recent discussion in the Insider News group that triggers a rethinking of the subject on my side. The first stage of the work is completed in Sept. 2023, it is and will be continue to be published online

  • On Vacuum
  • Quantum and Gravity







    Most recent software system to share:



    • V-NET[^] - Full stack virtualization management system including networking, storage, virtual machines and containers, with an emphasis on networking ... to be released.

Comments and Discussions