Click here to Skip to main content
15,896,495 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 132.2K   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>Application_ServiceProxy.AddOrUpdateEntities Method </title><meta name="Language" content="en-us" /><meta name="System.Keywords" content="AddOrUpdateEntities method" /><meta name="System.Keywords" content="Application_ServiceProxy.AddOrUpdateEntities method" /><meta name="Microsoft.Help.F1" content="CryptoGateway.RDB.Data.AspNetMember.Application_ServiceProxy.AddOrUpdateEntities" /><meta name="Microsoft.Help.Id" content="M:CryptoGateway.RDB.Data.AspNetMember.Application_ServiceProxy.AddOrUpdateEntities(CryptoGateway.RDB.Data.AspNetMember.CallContext,CryptoGateway.RDB.Data.AspNetMember.Application_Set,CryptoGateway.RDB.Data.AspNetMember.Application_[])" /><meta name="Description" content="Add or update a set of entities to the entity set." /><meta name="Microsoft.Help.ContentType" content="Reference" /><meta name="BrandingAware" content="'true'" /><meta name="container" content="CryptoGateway.RDB.Data.AspNetMember" /><meta name="file" content="5089cabb-e8b5-812a-ad33-77b78556d99e" /><meta name="guid" content="5089cabb-e8b5-812a-ad33-77b78556d99e" /><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">Application_ServiceProxy<span id="ID0EBBABAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EBBABAAA?vb=.|cpp=::|cs=.|fs=.|nu=.");
				</script>AddOrUpdateEntities 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">
              Add or update a set of entities to the entity set. 
            </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="ID0EDODAAAAA" class="OH_CodeSnippetContainer"><div class="OH_CodeSnippetContainerTabs" id="ID0EDODAAAAA_tabs"><div class="OH_CodeSnippetContainerTabLeftActive" id="ID0EDODAAAAA_tabimgleft"></div><div id="ID0EDODAAAAA_tab1" class="OH_CodeSnippetContainerTabActive" EnableCopyCode="true"><a href="#" onclick="javascript:ChangeTab('ID0EDODAAAAA','C#','1','4');return false;">C#</a></div><div id="ID0EDODAAAAA_tab2" class="OH_CodeSnippetContainerTab" EnableCopyCode="true"><a href="#" onclick="javascript:ChangeTab('ID0EDODAAAAA','Visual Basic','2','4');return false;">VB</a></div><div id="ID0EDODAAAAA_tab3" class="OH_CodeSnippetContainerTab" EnableCopyCode="true"><a href="#" onclick="javascript:ChangeTab('ID0EDODAAAAA','Visual C++','3','4');return false;">C++</a></div><div id="ID0EDODAAAAA_tab4" class="OH_CodeSnippetContainerTab" EnableCopyCode="true"><a href="#" onclick="javascript:ChangeTab('ID0EDODAAAAA','F#','4','4');return false;">F#</a></div><div class="OH_CodeSnippetContainerTabRight" id="ID0EDODAAAAA_tabimgright"></div></div><div id="ID0EDODAAAAA_codecollection" class="OH_CodeSnippetContainerCodeCollection"><div class="OH_CodeSnippetToolBar"><div class="OH_CodeSnippetToolBarText"><a id="ID0EDODAAAAA_ViewColorized" href="#" onclick="javascript:ExchangeTitleContent('ID0EDODAAAAA','4')" title="View Colorized" style="display: none">View Colorized</a><a id="ID0EDODAAAAA_copycode" href="#" onclick="javascript:CopyToClipboard('ID0EDODAAAAA','4')" title="Copy to Clipboard">Copy to Clipboard</a><a id="ID0EDODAAAAA_PrintText" class="OH_PrintText" href="#" onclick="javascript:Print('ID0EDODAAAAA','4')" title="Print">Print</a></div></div><div id="ID0EDODAAAAA_code_Div1" class="OH_CodeSnippetContainerCode" style="display: block"><pre><span class="keyword">public</span> <span class="identifier">ChangeOpResults</span>&lt;<span class="identifier">Application_UpdateResult</span>&gt; <span class="identifier">AddOrUpdateEntities</span>(
	<span class="identifier">CallContext</span> <span class="parameter">cntx</span>,
	<span class="identifier">Application_Set</span> <span class="parameter">set</span>,
	<span class="identifier">Application_</span>[] <span class="parameter">entities</span>
)</pre></div><div id="ID0EDODAAAAA_code_Plain_Div1" class="OH_CodeSnippetContainerCode" style="display: none"><pre>public ChangeOpResults&lt;Application_UpdateResult&gt; AddOrUpdateEntities(
	CallContext cntx,
	Application_Set set,
	Application_[] entities
)</pre></div><div id="ID0EDODAAAAA_code_Div2" class="OH_CodeSnippetContainerCode" style="display: none"><pre><span class="keyword">Public</span> <span class="keyword">Function</span> <span class="identifier">AddOrUpdateEntities</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">Application_Set</span>,
	<span class="parameter">entities</span> <span class="keyword">As</span> <span class="identifier">Application_</span>()
) <span class="keyword">As</span> <span class="identifier">ChangeOpResults</span>(<span class="keyword">Of</span> <span class="identifier">Application_UpdateResult</span>)</pre></div><div id="ID0EDODAAAAA_code_Plain_Div2" class="OH_CodeSnippetContainerCode" style="display: none"><pre>Public Function AddOrUpdateEntities ( 
	cntx As CallContext,
	set As Application_Set,
	entities As Application_()
) As ChangeOpResults(Of Application_UpdateResult)</pre></div><div id="ID0EDODAAAAA_code_Div3" class="OH_CodeSnippetContainerCode" style="display: none"><pre><span class="keyword">public</span>:
<span class="keyword">virtual</span> <span class="identifier">ChangeOpResults</span>&lt;<span class="identifier">Application_UpdateResult</span>^&gt;^ <span class="identifier">AddOrUpdateEntities</span>(
	<span class="identifier">CallContext</span>^ <span class="parameter">cntx</span>, 
	<span class="identifier">Application_Set</span>^ <span class="parameter">set</span>, 
	<span class="keyword">array</span>&lt;<span class="identifier">Application_</span>^&gt;^ <span class="parameter">entities</span>
) <span class="keyword">sealed</span></pre></div><div id="ID0EDODAAAAA_code_Plain_Div3" class="OH_CodeSnippetContainerCode" style="display: none"><pre>public:
virtual ChangeOpResults&lt;Application_UpdateResult^&gt;^ AddOrUpdateEntities(
	CallContext^ cntx, 
	Application_Set^ set, 
	array&lt;Application_^&gt;^ entities
) sealed</pre></div><div id="ID0EDODAAAAA_code_Div4" class="OH_CodeSnippetContainerCode" style="display: none"><pre><span class="keyword">abstract</span> <span class="identifier">AddOrUpdateEntities</span> : 
        <span class="parameter">cntx</span> : <span class="identifier">CallContext</span> * 
        <span class="parameter">set</span> : <span class="identifier">Application_Set</span> * 
        <span class="parameter">entities</span> : <span class="identifier">Application_</span>[] <span class="keyword">-&gt;</span> <span class="identifier">ChangeOpResults</span>&lt;<span class="identifier">Application_UpdateResult</span>&gt; 
<span class="keyword">override</span> <span class="identifier">AddOrUpdateEntities</span> : 
        <span class="parameter">cntx</span> : <span class="identifier">CallContext</span> * 
        <span class="parameter">set</span> : <span class="identifier">Application_Set</span> * 
        <span class="parameter">entities</span> : <span class="identifier">Application_</span>[] <span class="keyword">-&gt;</span> <span class="identifier">ChangeOpResults</span>&lt;<span class="identifier">Application_UpdateResult</span>&gt; </pre></div><div id="ID0EDODAAAAA_code_Plain_Div4" class="OH_CodeSnippetContainerCode" style="display: none"><pre>abstract AddOrUpdateEntities : 
        cntx : CallContext * 
        set : Application_Set * 
        entities : Application_[] -&gt; ChangeOpResults&lt;Application_UpdateResult&gt; 
override AddOrUpdateEntities : 
        cntx : CallContext * 
        set : Application_Set * 
        entities : Application_[] -&gt; ChangeOpResults&lt;Application_UpdateResult&gt; </pre></div></div></div><script>addSpecificTextLanguageTagSet('ID0EDODAAAAA');</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="ID0EBCACNDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EBCACNDAAAAA?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="7e12775d-4811-1581-271f-8c96a3876781.htm" target="">CryptoGateway.RDB.Data.AspNetMember<span id="ID0EBCABNDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EBCABNDAAAAA?vb=.|cpp=::|cs=.|fs=.|nu=.");
				</script>Application_Set</a><br /><span>The current entity set.</span></dd></dl><dl paramName="entities"><dt><span class="parameter">entities</span></dt><dd>Type: <span id="ID0EEAANDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EEAANDAAAAA?vb=|cpp=array&lt;|cs=|fs=|nu=");
				</script><a href="e59dd5e0-4a7f-3cd6-7534-5caf397c080c.htm" target="">CryptoGateway.RDB.Data.AspNetMember<span id="ID0EBDAANDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EBDAANDAAAAA?vb=.|cpp=::|cs=.|fs=.|nu=.");
				</script>Application_</a><span id="ID0ECAANDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0ECAANDAAAAA?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: <a href="234ecf67-cef6-fe4a-fdf7-c93b5cda2ec1.htm" target="">ChangeOpResults</a><span id="ID0EJDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EJDAAAAA?vb=(Of |cpp=&lt;|cs=&lt;|fs=&lt;'|nu=(");
				</script><a href="d9e36051-6d97-98f0-ed04-176b9db2260e.htm" target="">Application_UpdateResult</a><span id="ID0EHDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EHDAAAAA?vb=)|cpp=&gt;|cs=&gt;|fs=&gt;|nu=)");
				</script><br />
              Operation result contained inside an object of type <a href="234ecf67-cef6-fe4a-fdf7-c93b5cda2ec1.htm" target="">ChangeOpResults<span id="ID0ECEDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0ECEDAAAAA?vb=(Of |cpp=&lt;|cs=&lt;|fs=&lt;'|nu=(");
				</script>Entity<span id="ID0EAEDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EAEDAAAAA?vb=)|cpp=&gt;|cs=&gt;|fs=&gt;|nu=)");
				</script></a> which contains operation messages, if any, and a list of successfully added or updated entities.
            <h4 class="subHeading">Implements</h4><a href="1935be3e-d302-7a97-3cbf-48202d74e8d5.htm" target="">IApplication_Service2<span id="ID0EFBDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EFBDAAAAA?vb=.|cpp=::|cs=.|fs=.|nu=.");
				</script>AddOrUpdateEntities(CallContext, Application_Set, <span id="ID0EDBDAAAAA"> </span><script type="text/javascript">
					addToLanSpecTextIdSet("ID0EDBDAAAAA?vb=|cpp=array&lt;|cs=|fs=|nu=");
				</script>Application_<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 list of entities will be checked against existing ones inside the entity set. 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 <a href="4ede0a91-8d94-41af-852f-c2d523749c47.htm" target="">OverrideExisting</a> 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 operations. 
             </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="e59dd5e0-4a7f-3cd6-7534-5caf397c080c.htm" target="">Application_</a>) is modified or its <a href="1a33cf32-afe3-7def-edcd-80a783887f5f.htm" target="">IsEntityChanged</a> property is
             not set to <span class="code">true</span>. 
             </p><p>
             Clients can also create and add to member collections in { <a href="ef4cf354-453c-4cb4-5f90-a5045a0d868f.htm" target="">ChangedRoles</a>, <a href="b8a6411a-1c6e-f1c7-f5f0-e34fdde605a7.htm" target="">ChangedUserAppMembers</a>, <a href="d5e6fc00-a479-b624-1115-94a66dbf5d55.htm" target="">ChangedUserProfiles</a> } entities that depends on an currently added or updated entity. 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="b1e30d3a-7b02-2fe6-2461-104d96a93971.htm" target="">Application_ServiceProxy Class</a></div><div class="seeAlsoStyle"><a href="df36110b-864a-6b4d-8965-3fc3c56b0bc9.htm" target="">Application_ServiceProxy 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+Application_ServiceProxy.AddOrUpdateEntities+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