Click here to Skip to main content
15,887,683 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.7K   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>IUserService2.LoadEntityGraphRecurs Method </title><meta name="Language" content="en-us" /><meta name="System.Keywords" content="LoadEntityGraphRecurs method" /><meta name="System.Keywords" content="IUserService2.LoadEntityGraphRecurs method" /><meta name="Microsoft.Help.F1" content="CryptoGateway.RDB.Data.AspNetMember.IUserService2.LoadEntityGraphRecurs" /><meta name="Microsoft.Help.Id" content="M:CryptoGateway.RDB.Data.AspNetMember.IUserService2.LoadEntityGraphRecurs(CryptoGateway.RDB.Data.AspNetMember.CallContext,System.String,CryptoGateway.RDB.Data.AspNetMember.EntitySetType[],CryptoGateway.RDB.Data.AspNetMember.EntitySetRelation[])" /><meta name="Description" content="Load a selected entity graph from the data source starting at an entity having specified primary key(s): { }." /><meta name="Microsoft.Help.ContentType" content="Reference" /><meta name="BrandingAware" content="'true'" /><meta name="container" content="CryptoGateway.RDB.Data.AspNetMember" /><meta name="file" content="566f6094-8b79-7261-567a-07817235d70b" /><meta name="guid" content="566f6094-8b79-7261-567a-07817235d70b" /><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">IUserService2<span id="ID0EBBABAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EBBABAAA?vb=.|cpp=::|cs=.|fs=.|nu=.");
				</script>LoadEntityGraphRecurs 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">
             Load a selected entity graph from the data source starting at an entity having specified primary key(s): { <a href="fc265d5b-11f0-216d-e8a4-b1c697ce0f5a.htm" target="">ID</a> }. 
            </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">AspNetMemberShared</span> (in AspNetMemberShared.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="ID0EDGDAAAAA" class="OH_CodeSnippetContainer"><div class="OH_CodeSnippetContainerTabs" id="ID0EDGDAAAAA_tabs"><div class="OH_CodeSnippetContainerTabLeftActive" id="ID0EDGDAAAAA_tabimgleft"></div><div id="ID0EDGDAAAAA_tab1" class="OH_CodeSnippetContainerTabActive" EnableCopyCode="true"><a href="#" onclick="javascript:ChangeTab('ID0EDGDAAAAA','C#','1','4');return false;">C#</a></div><div id="ID0EDGDAAAAA_tab2" class="OH_CodeSnippetContainerTab" EnableCopyCode="true"><a href="#" onclick="javascript:ChangeTab('ID0EDGDAAAAA','Visual Basic','2','4');return false;">VB</a></div><div id="ID0EDGDAAAAA_tab3" class="OH_CodeSnippetContainerTab" EnableCopyCode="true"><a href="#" onclick="javascript:ChangeTab('ID0EDGDAAAAA','Visual C++','3','4');return false;">C++</a></div><div id="ID0EDGDAAAAA_tab4" class="OH_CodeSnippetContainerTab" EnableCopyCode="true"><a href="#" onclick="javascript:ChangeTab('ID0EDGDAAAAA','F#','4','4');return false;">F#</a></div><div class="OH_CodeSnippetContainerTabRight" id="ID0EDGDAAAAA_tabimgright"></div></div><div id="ID0EDGDAAAAA_codecollection" class="OH_CodeSnippetContainerCodeCollection"><div class="OH_CodeSnippetToolBar"><div class="OH_CodeSnippetToolBarText"><a id="ID0EDGDAAAAA_ViewColorized" href="#" onclick="javascript:ExchangeTitleContent('ID0EDGDAAAAA','4')" title="View Colorized" style="display: none">View Colorized</a><a id="ID0EDGDAAAAA_copycode" href="#" onclick="javascript:CopyToClipboard('ID0EDGDAAAAA','4')" title="Copy to Clipboard">Copy to Clipboard</a><a id="ID0EDGDAAAAA_PrintText" class="OH_PrintText" href="#" onclick="javascript:Print('ID0EDGDAAAAA','4')" title="Print">Print</a></div></div><div id="ID0EDGDAAAAA_code_Div1" class="OH_CodeSnippetContainerCode" style="display: block"><pre>[<span class="identifier">OperationContractAttribute</span>]
<span class="identifier">User</span> <span class="identifier">LoadEntityGraphRecurs</span>(
	<span class="identifier">CallContext</span> <span class="parameter">cntx</span>,
	<span class="identifier">string</span> <span class="parameter">_ID</span>,
	<span class="identifier">EntitySetType</span>[] <span class="parameter">excludedSets</span>,
	<span class="identifier">EntitySetRelation</span>[] <span class="parameter">futherDrillSets</span>
)</pre></div><div id="ID0EDGDAAAAA_code_Plain_Div1" class="OH_CodeSnippetContainerCode" style="display: none"><pre>[OperationContractAttribute]
User LoadEntityGraphRecurs(
	CallContext cntx,
	string _ID,
	EntitySetType[] excludedSets,
	EntitySetRelation[] futherDrillSets
)</pre></div><div id="ID0EDGDAAAAA_code_Div2" class="OH_CodeSnippetContainerCode" style="display: none"><pre>&lt;<span class="identifier">OperationContractAttribute</span>&gt; 
<span class="keyword">Function</span> <span class="identifier">LoadEntityGraphRecurs</span> ( 
	<span class="parameter">cntx</span> <span class="keyword">As</span> <span class="identifier">CallContext</span>,
	<span class="parameter">_ID</span> <span class="keyword">As</span> <span class="identifier">String</span>,
	<span class="parameter">excludedSets</span> <span class="keyword">As</span> <span class="identifier">EntitySetType</span>(),
	<span class="parameter">futherDrillSets</span> <span class="keyword">As</span> <span class="identifier">EntitySetRelation</span>()
) <span class="keyword">As</span> <span class="identifier">User</span></pre></div><div id="ID0EDGDAAAAA_code_Plain_Div2" class="OH_CodeSnippetContainerCode" style="display: none"><pre>&lt;OperationContractAttribute&gt; 
Function LoadEntityGraphRecurs ( 
	cntx As CallContext,
	_ID As String,
	excludedSets As EntitySetType(),
	futherDrillSets As EntitySetRelation()
) As User</pre></div><div id="ID0EDGDAAAAA_code_Div3" class="OH_CodeSnippetContainerCode" style="display: none"><pre>[<span class="identifier">OperationContractAttribute</span>]
<span class="identifier">User</span>^ <span class="identifier">LoadEntityGraphRecurs</span>(
	<span class="identifier">CallContext</span>^ <span class="parameter">cntx</span>, 
	<span class="identifier">String</span>^ <span class="parameter">_ID</span>, 
	<span class="keyword">array</span>&lt;<span class="identifier">EntitySetType</span>&gt;^ <span class="parameter">excludedSets</span>, 
	<span class="keyword">array</span>&lt;<span class="identifier">EntitySetRelation</span>^&gt;^ <span class="parameter">futherDrillSets</span>
)</pre></div><div id="ID0EDGDAAAAA_code_Plain_Div3" class="OH_CodeSnippetContainerCode" style="display: none"><pre>[OperationContractAttribute]
User^ LoadEntityGraphRecurs(
	CallContext^ cntx, 
	String^ _ID, 
	array&lt;EntitySetType&gt;^ excludedSets, 
	array&lt;EntitySetRelation^&gt;^ futherDrillSets
)</pre></div><div id="ID0EDGDAAAAA_code_Div4" class="OH_CodeSnippetContainerCode" style="display: none"><pre>[&lt;<span class="identifier">OperationContractAttribute</span>&gt;]
<span class="keyword">abstract</span> <span class="identifier">LoadEntityGraphRecurs</span> : 
        <span class="parameter">cntx</span> : <span class="identifier">CallContext</span> * 
        <span class="parameter">_ID</span> : <span class="identifier">string</span> * 
        <span class="parameter">excludedSets</span> : <span class="identifier">EntitySetType</span>[] * 
        <span class="parameter">futherDrillSets</span> : <span class="identifier">EntitySetRelation</span>[] <span class="keyword">-&gt;</span> <span class="identifier">User</span></pre></div><div id="ID0EDGDAAAAA_code_Plain_Div4" class="OH_CodeSnippetContainerCode" style="display: none"><pre>[&lt;OperationContractAttribute&gt;]
abstract LoadEntityGraphRecurs : 
        cntx : CallContext * 
        _ID : string * 
        excludedSets : EntitySetType[] * 
        futherDrillSets : EntitySetRelation[] -&gt; User</pre></div></div></div><script>addSpecificTextLanguageTagSet('ID0EDGDAAAAA');</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="ID0EBCADFDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EBCADFDAAAAA?vb=.|cpp=::|cs=.|fs=.|nu=.");
				</script>CallContext</a><br /><span>Authenticated caller context object. If cannot be null.</span></dd></dl><dl paramName="_ID"><dt><span class="parameter">_ID</span></dt><dd>Type: <img src="./../icons/online_icon.gif" class="OH_offlineIcon" alt="Online" title="Online" /><a href="http://msdn2.microsoft.com/en-us/library/s1wwdcbf" target="_blank">System<span id="ID0EBCACFDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EBCACFDAAAAA?vb=.|cpp=::|cs=.|fs=.|nu=.");
				</script>String</a><br /><span>Primary key <a href="fc265d5b-11f0-216d-e8a4-b1c697ce0f5a.htm" target="">ID</a>.</span></dd></dl><dl paramName="excludedSets"><dt><span class="parameter">excludedSets</span></dt><dd>Type: <span id="ID0EEABFDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EEABFDAAAAA?vb=|cpp=array&lt;|cs=|fs=|nu=");
				</script><a href="7c9fef88-569a-fb6f-ab8d-2e478bfbae8d.htm" target="">CryptoGateway.RDB.Data.AspNetMember<span id="ID0EBDABFDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EBDABFDAAAAA?vb=.|cpp=::|cs=.|fs=.|nu=.");
				</script>EntitySetType</a><span id="ID0ECABFDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0ECABFDAAAAA?vb=()|cpp=&gt;|cs=[]|fs=[]|nu=[]");
				</script><br /><span>A list of sets to be excluded. </span></dd></dl><dl paramName="futherDrillSets"><dt><span class="parameter">futherDrillSets</span></dt><dd>Type: <span id="ID0EEAAFDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EEAAFDAAAAA?vb=|cpp=array&lt;|cs=|fs=|nu=");
				</script><a href="b6da89ae-3096-7152-9012-628cbbca2a10.htm" target="">CryptoGateway.RDB.Data.AspNetMember<span id="ID0EBDAAFDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EBDAAFDAAAAA?vb=.|cpp=::|cs=.|fs=.|nu=.");
				</script>EntitySetRelation</a><span id="ID0ECAAFDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0ECAAFDAAAAA?vb=()|cpp=&gt;|cs=[]|fs=[]|nu=[]");
				</script><br /><span>A list of sets above the entry set that are to be drilled down futher (see the following). </span></dd></dl></div><h4 class="subHeading">Return Value</h4>Type: <a href="12905576-1481-c6a2-2cd8-2e33c9d8b651.htm" target="">User</a><br />
              Null or the entity graph found.
            <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>Relational databases are designed to serve as data query and storage backend, in a normalized way, for certain kind of applications. 
            However at the application level, normalized elementary data sets are often combined (jointed) in a user friendly way as views. In the object oriented 
            world and at the data view model level, these views can be represented using entity graphs.</p><p>This method is designed to load a selected sub entity graph recursively from the data source in one call to the service starting with a given entity (id).
            It could be used to increase performance and to reduce client code complexity, sometimes significantly.</p><p>The selection is controlled by two parameters, namely <span class="parameter">excludedSets</span> and <span class="parameter">futherDrillSets</span>.</p><p>The <span class="parameter">excludedSets</span> parameter is used to exclude a list of entity sets and all other sets that depend on it. This can be
            better understood if one has a look at the schematic view of the data set schema that is shown on the front page of the data service, namely
            if one date set (node) is excluded then all the sets that it points to will not be reached through it, although some of them could still be reached
            following other routes. </p><p>There are many ways an entity sub-graph can be loaded, the present implementation is based on the rule to be given next. Namely, starting from 
            the entry element, it loads all entities that depends on it, recursively downward (namely following the arrows in the schema view). It also loads all 
            elements that any of the elements visited by the downward recursion depends upon, recursively upward (namely in 
            the opposite direction of the arrows in the schema view), but never go downward again without explicit instruction.</p><p>The <span class="parameter">futherDrillSets</span> parameter is used control when to go downward again, represented by the <a href="61a8590a-7d8f-4501-42a6-437c67fee2e0.htm" target="">SetType</a> member 
            and the collection of data sets that depend on it, represented by the <a href="eca42a0c-ce8b-d909-03b5-3f474b5f51d4.htm" target="">RelatedSets</a> member, should be further drilled down, recursively.</p><p>Note that a data service has intrinsic limits that do not allow transmitting an entity graph that is too large in one call, so one has to select which part
            of the entire graph should be loaded in each call to the data service,</p><p>For a given entity, the entities that it depends upon are represented by the member objects corresponding to each foreign keys. However, the
            sets of entities that depend on the said entity are stored into the corresponding collection members having the "Changed" prefix and
            these entities do not have a back reference to the said entity to avoid circular references when doing serialization, Such back references can be
            added after the graph is materialized on the clients side, if needed.</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="f4c79eff-8533-c787-5e21-1065ae28fe5d.htm" target="">IUserService2 Interface</a></div><div class="seeAlsoStyle"><a href="238d7d79-32ca-fa8e-afdc-6f3ef3e0d8c4.htm" target="">IUserService2 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+IUserService2.LoadEntityGraphRecurs+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