<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Link For Authentication</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Link For Authentication</description>
  <pubDate>Wed, 13 May 2026 11:36:46 -700</pubDate>
  <lastBuildDate>Tue, 24 Jan 2012 02:07:11 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=3193</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Link For Authentication :   Hello Marcel,I&amp;#039;ve checked...one...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12538#12538</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1136" rel="nofollow">pponzano</a><br /><strong>Subject:</strong> 3193<br /><strong>Posted:</strong> 24-Jan-2012 at 2:07am<br /><br />Hello Marcel,<div>I've checked...</div><div>&nbsp;</div><div>one of my EntityManagerProvider is </div><div>&nbsp;</div><div><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"><p style="margin: 0px;"><span style="color: blue;">public</span> <span style="color: blue;">class</span> <span style="color: rgb43, 145, 175;">EntityManagerProvider</span> : <span style="color: rgb43, 145, 175;">BaseEntityManagerProvider</span>&lt;my<span style="color: rgb43, 145, 175;">Entities</span>&gt;</p><p style="margin: 0px;">&nbsp;&nbsp; {</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <span style="color: blue;">protected</span> <span style="color: blue;">override</span> <span style="color: rgb43, 145, 175;">myEntities</span> CreateEntityManager()</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; {</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <span style="color: blue;">return</span> <span style="color: blue;">new</span> my<span style="color: rgb43, 145, 175;">Entities</span>();</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; }</p><p style="margin: 0px;">&nbsp;&nbsp; }</p></div><!--EndFragment--></div><div>&nbsp;</div><div>I've also tried putting &#091;Export&#093; and &#091;Export(typeof(<span style="color: rgb43, 145, 175;">EntityManagerProvider</span> )&#093; but I always get</div><div>&nbsp;</div><div>Could not locate any instances of contract my.ViewModels.ShellViewModel where ShellViewModel is defined as</div><div>&nbsp;</div><div><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"><p style="margin: 0px;">&#091;<span style="color: rgb43, 145, 175;">Export</span>&#093;</p><p style="margin: 0px;">&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">class</span> <span style="color: rgb43, 145, 175;">ShellViewModel</span> : <span style="color: rgb43, 145, 175;">Conductor</span>&lt;<span style="color: rgb43, 145, 175;">IScreen</span>&gt;.<span style="color: rgb43, 145, 175;">Collection</span>.<span style="color: rgb43, 145, 175;">OneActive</span>, <span style="color: rgb43, 145, 175;">IHandle</span>&lt;<span style="color: rgb43, 145, 175;">ActivateWorkspaceMessage</span>&gt;, <span style="color: rgb43, 145, 175;">ITaggable</span></p><p style="margin: 0px;">&nbsp;&nbsp; {</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <span style="color: blue;">private</span> <span style="color: blue;">readonly</span> <span style="color: rgb43, 145, 175;">Lazy</span>&lt;<span style="color: rgb43, 145, 175;">LoginViewModel</span>&gt; _login;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <span style="color: blue;">private</span> <span style="color: blue;">readonly</span> <span style="color: rgb43, 145, 175;">Lazy</span>&lt;<span style="color: rgb43, 145, 175;">WorkspaceViewModel</span>&gt; _workspace;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <span style="color: blue;">private</span> <span style="color: rgb43, 145, 175;">IApplicationRepository</span> _repository;</p><p style="margin: 0px;">&nbsp;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &#091;<span style="color: rgb43, 145, 175;">ImportingConstructor</span>&#093;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <span style="color: blue;">public</span> ShellViewModel(<span style="color: rgb43, 145, 175;">IEventAggregator</span> eventAggregator, <span style="color: rgb43, 145, 175;">Lazy</span>&lt;<span style="color: rgb43, 145, 175;">LoginViewModel</span>&gt; login,</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb43, 145, 175;">Lazy</span>&lt;<span style="color: rgb43, 145, 175;">WorkspaceViewModel</span>&gt; workspace, <span style="color: rgb43, 145, 175;">IApplicationRepository</span> repository)</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; {</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <span style="color: blue;">this</span>.DisplayName = ExtendedDescription;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; eventAggregator.Subscribe(<span style="color: blue;">this</span>);</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; _login = login;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; _workspace = workspace;</p><p style="margin: 0px;">&nbsp;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; _repository = repository;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; }</p><div></div><p style="margin: 0px;"></p><div>&nbsp;</div><div>I've notice I don't have a EntityManagerProviderFactory, is this the problem?</div><div>Thanks</div></div><!--EndFragment--></div>]]>
   </description>
   <pubDate>Tue, 24 Jan 2012 02:07:11 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12538#12538</guid>
  </item> 
  <item>
   <title>Link For Authentication :   Hello Marcel,I&amp;#039;ll take...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12537#12537</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1136" rel="nofollow">pponzano</a><br /><strong>Subject:</strong> 3193<br /><strong>Posted:</strong> 24-Jan-2012 at 1:50am<br /><br />Hello Marcel,<div>I'll take a look in a short... what I did was based on the point</div><div>&nbsp;</div><div>Sharing a single EntityManagerProvider</div><div>&nbsp;</div><div>of <a href="http://devforcecaliburn.codeplex.com/wikipage?title=The%20EntityManager%20Provider&amp;referringTitle=&#068;ocumentati&#111;n" target="_blank">http://devforcecaliburn.codeplex.com/wikipage?title=The%20EntityManager%20Provider&amp;referringTitle=Documentation</a></div><div>&nbsp;</div><div>btw I'll take a look and give you a feedback</div><div>Thanks</div>]]>
   </description>
   <pubDate>Tue, 24 Jan 2012 01:50:29 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12537#12537</guid>
  </item> 
  <item>
   <title>Link For Authentication :   Well, then there&amp;#039;s something...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12536#12536</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3193<br /><strong>Posted:</strong> 24-Jan-2012 at 1:09am<br /><br />Well, then there's something wrong in how you have things setup. You do not need to set batch.AddExportedValue(). My hunch is you forgot to export the EntityManagerProviders, so MEF can't instantiate your repositories, because it can't find the appropriate EntityManagerProvider. Check your output window, you should see MEF error messages that tell you what's missing. <div>&nbsp;</div><div>See here: <a href="http://devforcecaliburn.codeplex.com/wikipage?title=The%20EntityManager%20Provider&amp;referringTitle=&#068;ocumentati&#111;n" target="_blank">http://devforcecaliburn.codeplex.com/wikipage?title=The%20EntityManager%20Provider&amp;referringTitle=Documentation</a>&nbsp;for how to export the EntityManagerProvider. The simple tutorial I have here <a href="http://devforcecaliburn.codeplex.com/wikipage?title=Building%20a%20simple%20applicati&#111;n&amp;referringTitle=&#068;ocumentati&#111;n" target="_blank">http://devforcecaliburn.codeplex.com/wikipage?title=Building%20a%20simple%20application&amp;referringTitle=Documentation</a>&nbsp;discusses how to do it as well.</div>]]>
   </description>
   <pubDate>Tue, 24 Jan 2012 01:09:06 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12536#12536</guid>
  </item> 
  <item>
   <title>Link For Authentication :   Excuse me Marcel,the code...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12535#12535</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1136" rel="nofollow">pponzano</a><br /><strong>Subject:</strong> 3193<br /><strong>Posted:</strong> 24-Jan-2012 at 12:14am<br /><br />Excuse me Marcel,<div>the code I pasted below is relative to </div><div><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"><span style="color: blue;"><div></div><p style="margin: 0px;">protected</p></span><p style="margin: 0px;"><span style="color: blue;">override</span> <span style="color: blue;">void</span> InitializeCompositionBatch(<span style="color: rgb43, 145, 175;">CompositionBatch</span> batch)</p></div></font><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"><p style="margin: 0px;"></p></div></font><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"><p style="margin: 0px;"></p></div></font><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"><p style="margin: 0px;">If I don't add the exported value on my repositories they won't be ignected to my models... </p></div><p><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">for example one repository is </font></font></p><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"><div></div><div></div><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"><p style="margin: 0px;">&#091;<span style="color: rgb43, 145, 175;">Export</span>(<span style="color: blue;">typeof</span>(<span style="color: rgb43, 145, 175;">IExportRepository</span>))&#093;</p><p style="margin: 0px;"> <span style="color: blue;">public</span> <span style="color: blue;">class</span> <span style="color: rgb43, 145, 175;">ExportRepository</span> : I<span style="color: rgb43, 145, 175;">ExportRepository</span></p></div><!--EndFragment--><div></div><div></div>and it's called as<div></div><div></div><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"></div><p style=": white; margin: 0px; color: black; font-family: C&#111;nsolas; font-size: 10pt;">&#091;<span style="color: rgb43, 145, 175;">Import</span>&#093;</p><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"></div><p style=": white; margin: 0px; color: black; font-family: C&#111;nsolas; font-size: 10pt;">       <span style="color: blue;">private</span> <span style="color: rgb43, 145, 175;"><font color="#000000">I</font><span style="color: rgb43, 145, 175;">ExportRepository</span></span>_repository;</p><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"></div><p style=": white; margin: 0px; color: black; font-family: C&#111;nsolas; font-size: 10pt;"> </p><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"></div><p style=": white; margin: 0px; color: black; font-family: C&#111;nsolas; font-size: 10pt;">       &#091;<span style="color: rgb43, 145, 175;">ImportingConstructor</span>&#093;</p><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"></div><p style=": white; margin: 0px; color: black; font-family: C&#111;nsolas; font-size: 10pt;">       <span style="color: blue;">public</span> ShellViewModel(<span style="color: rgb43, 145, 175;">IEventAggregator</span> eventAggregator, <span style="color: rgb43, 145, 175;">Lazy</span>&lt;<span style="color: rgb43, 145, 175;">LoginViewModel</span>&gt; login,</p><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"></div><p style=": white; margin: 0px; color: black; font-family: C&#111;nsolas; font-size: 10pt;">                             <span style="color: rgb43, 145, 175;">Lazy</span>&lt;<span style="color: rgb43, 145, 175;">WorkspaceViewModel</span>&gt; workspace,I<span style="color: rgb43, 145, 175;">ExportRepository exportRepository)</span></p><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"></div><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"> </div><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;">but if I don't set the </div><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"><p> <div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"><p style="margin: 0px;">batch.AddExportedValue&lt;<span style="color: rgb43, 145, 175;">IExportRepository</span>&gt;(iExportRepository); in BootStrapper it won't work...</p></div><p><!--EndFragment--></p></font><p></p></font><p><p> </p><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"></font></font></div><!--EndFragment--></font></font></div>]]>
   </description>
   <pubDate>Tue, 24 Jan 2012 00:14:17 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12535#12535</guid>
  </item> 
  <item>
   <title>Link For Authentication :   No, that doesn&amp;#039;t look...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12521#12521</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3193<br /><strong>Posted:</strong> 23-Jan-2012 at 12:24am<br /><br />No, that doesn't look right. You are hardwiring all your dependencies.&nbsp;One never explicity calls LinkForAuthentication. DAF uses MEF to wire up your dependencies and handles things like LinkForAuthentication for you. <div>&nbsp;</div><div>Use &#091;ImportingConstructor&#093; on your repositories and let MEF satisfy the dependencies for you. How&nbsp;to do this stuff is explained in the documentation on CodePlex. Follow that structure.&nbsp;</div><div>&nbsp;</div><div><span style="color: blue;">var</span> admin = <span style="color: blue;">new</span> <span>AuthenticationService</span>&lt;<span>Entities</span>&gt;(<strike>provider.Manager</strike>);</div><div>&nbsp;</div><div>Don't pass a hardwired manager to the AuthenticationService. It will grab the correct one automatically. The ability to pass a specific EntityManager is for testing purposes. Learn the concept of inversion of control. The point of IoC is you don't hardwire the dependencies like you do here. You let the IoC container (MEF in this case) satisfy the dependencies. I crossed out the parts to don't seem to need below. Use the &#091;Export&#093; attribute on your repository classes to register them in the MEF container and use &#091;ImportingConstructor&#093; on the constructor to tell MEF to inject the EntityManagerProvider.</div><div>&nbsp;</div><div><div><div style="color: black; font-family: C&#111;nsolas; font-size: 10pt;"><p style="margin: 0px;"><strike><span style="color: blue;">var</span> provider = <span style="color: blue;">new</span> <span>EntityManagerProvider</span>();</strike></p><p style="margin: 0px;"><strike>        <span style="color: blue;">var</span> chProvider = <span style="color: blue;">new</span> <span>CHEntityManagerProvider</span>();</strike></p><p style="margin: 0px;"><strike>        <span style="color: blue;">var</span> ExportProvider = <span style="color: blue;">new</span> <span>ExportEntityManagerProvider</span>();</strike></p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p><span style="color: blue;"><div><strike>var</strike></span><strike>Repository = <span style="color: blue;">new</span> <span>myRepository</span>(provider);</strike></div><p style="margin: 0px;"><strike>        <span style="color: blue;">var</span> chRepository = <span style="color: blue;">new</span> <span>CHRepository</span>(chProvider);</strike></p><p style="margin: 0px;"><strike>        <span style="color: blue;">var</span> ExportRepository = <span style="color: blue;">new</span> <span>ExportRepository</span>(ExportProvider);</strike></p><p style="margin: 0px;"><strike> </strike></p><p style="margin: 0px;"><strike>        batch.AddExportedValue&lt;<span>IApplicationRepository</span>&gt;(Repository);</strike></p><p style="margin: 0px;"><strike>        batch.AddExportedValue&lt;<span>ICHApplicationRepository</span>&gt;(chRepository);</strike></p><p style="margin: 0px;"><strike>        batch.AddExportedValue&lt;<span>IExportRepository</span>&gt;(ExportRepository);</strike></p><p style="margin: 0px;"> </p><p style="margin: 0px;">        <span style="color: blue;">var</span> admin = <span style="color: blue;">new</span> <span>AuthenticationService</span>&lt;<span>Entities</span>&gt;(<strike>provider.Manager</strike>);</p><p style="margin: 0px;"> </p><p style="margin: 0px;">        <strike>chProvider.Manager.LinkForAuthentication(provider);</strike></p><p style="margin: 0px;"><strike>        ExportProvider.Manager.LinkForAuthentication(provider);</strike></p><p style="margin: 0px;"> </p><p style="margin: 0px;">        batch.AddExportedValue&lt;<span>IAuthenticationService</span>&gt;(admin);</p></div></div></div>]]>
   </description>
   <pubDate>Mon, 23 Jan 2012 00:24:41 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12521#12521</guid>
  </item> 
  <item>
   <title>Link For Authentication :   Hello Marcel,when you say...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12520#12520</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1136" rel="nofollow">pponzano</a><br /><strong>Subject:</strong> 3193<br /><strong>Posted:</strong> 23-Jan-2012 at 12:04am<br /><br />Hello Marcel,<div></div>when you say DAF is taking care of everything you mean of logging out? since I use DAF.... in my InitializeCompositionBatch it's<div>&nbsp;</div><div><div style=": white; color: black; font-family: C&#111;nsolas; font-size: 10pt;"><p style="margin: 0px;"><span style="color: blue;">var</span> provider = <span style="color: blue;">new</span> <span style="color: rgb43, 145, 175;">EntityManagerProvider</span>();</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">var</span> chProvider = <span style="color: blue;">new</span> <span style="color: rgb43, 145, 175;">CHEntityManagerProvider</span>();</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">var</span> ExportProvider = <span style="color: blue;">new</span> <span style="color: rgb43, 145, 175;">ExportEntityManagerProvider</span>();</p><p style="margin: 0px;">&nbsp;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">var</span> Repository = <span style="color: blue;">new</span> <span style="color: rgb43, 145, 175;">myRepository</span>(provider);</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">var</span> chRepository = <span style="color: blue;">new</span> <span style="color: rgb43, 145, 175;">CHRepository</span>(chProvider);</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">var</span> ExportRepository = <span style="color: blue;">new</span> <span style="color: rgb43, 145, 175;">ExportRepository</span>(ExportProvider);</p><p style="margin: 0px;">&nbsp;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; batch.AddExportedValue&lt;<span style="color: rgb43, 145, 175;">IApplicationRepository</span>&gt;(Repository);</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; batch.AddExportedValue&lt;<span style="color: rgb43, 145, 175;">ICHApplicationRepository</span>&gt;(chRepository);</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; batch.AddExportedValue&lt;<span style="color: rgb43, 145, 175;">IExportRepository</span>&gt;(ExportRepository);</p><p style="margin: 0px;">&nbsp;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">var</span> admin = <span style="color: blue;">new</span> <span style="color: rgb43, 145, 175;">AuthenticationService</span>&lt;<span style="color: rgb43, 145, 175;">Entities</span>&gt;(provider.Manager);</p><p style="margin: 0px;">&nbsp;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; chProvider.Manager.LinkForAuthentication(provider);</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ExportProvider.Manager.LinkForAuthentication(provider);</p><p style="margin: 0px;">&nbsp;</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; batch.AddExportedValue&lt;<span style="color: rgb43, 145, 175;">IAuthenticationService</span>&gt;(admin);</p><div>&nbsp;</div><div>is it ok?</div><div>Thanks</div></div><!--EndFragment--></div>]]>
   </description>
   <pubDate>Mon, 23 Jan 2012 00:04:07 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12520#12520</guid>
  </item> 
  <item>
   <title>Link For Authentication :   Originally posted by pponzanoexcuse...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12506#12506</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3193<br /><strong>Posted:</strong> 20-Jan-2012 at 10:46am<br /><br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by pponzano</strong></em><br /><br />excuse me,<br>I'm facing a similar situation... I've got 3 model's one is authenticated and the other 2 no...<br>I've not used the LinkAuthentication, how should I put it? inside my IEntityLoginManager in the <br><br>public System.Security.Principal.IPrincipal Login(ILoginCredential credential, EntityManager entityManager)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>}<br>??<br><br>Thanks<br>Paolo<br></td></tr></table><div>&nbsp;</div><div>LinkForAuthentication is used on the client, so that only one EntityManager has to login and the other EntityManagers simply link themselves to the same session. Generally, you have a master EntityManager that is used to login at the beginning of the application and then any other EntityManager created throughout the lifecycle of the application is linked to the Master EntityManager's session.</div><div>&nbsp;</div><div>var master = new SomeEntityManager();</div><div>master.Login(....)&nbsp; // or LoginAsync()</div><div>&nbsp;</div><div>var em = new SomeOtherEntityManager();</div><div>em.LinkForAuthentication(master);</div><div>&nbsp;</div><div>Logout gets a little trickier, because once an EntityManager has a session you have to call Logout on it before you can link it to another session, so generally the safe approach is to just release all EntityManagers when the application logs out and create new ones when a new user logs in.</div><div>&nbsp;</div><div>If you use the DevForce Application Framework, all of this is taken care of for you by the AuthenticationService&lt;T&gt; and BaseEntityManagerProvider&lt;T&gt;. The original poster was simply missing the LoginManager on the server for some of his CompositionContexts, so the login didn't actually properly work on the server. The client was doing the right thing all along, since he is using DAF.</div><div>&nbsp;</div>]]>
   </description>
   <pubDate>Fri, 20 Jan 2012 10:46:26 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12506#12506</guid>
  </item> 
  <item>
   <title>Link For Authentication : excuse me,I&amp;#039;m facing a similar...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12504#12504</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1136" rel="nofollow">pponzano</a><br /><strong>Subject:</strong> 3193<br /><strong>Posted:</strong> 20-Jan-2012 at 8:46am<br /><br />excuse me,<br>I'm facing a similar situation... I've got 3 model's one is authenticated and the other 2 no...<br>I've not used the LinkAuthentication, how should I put it? inside my IEntityLoginManager in the <br><br>public System.Security.Principal.IPrincipal Login(ILoginCredential credential, EntityManager entityManager)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>}<br>??<br><br>Thanks<br>Paolo<br>]]>
   </description>
   <pubDate>Fri, 20 Jan 2012 08:46:15 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12504#12504</guid>
  </item> 
  <item>
   <title>Link For Authentication :   Yep, that was gonna be my...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12381#12381</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3193<br /><strong>Posted:</strong> 06-Jan-2012 at 4:59am<br /><br />Yep, that was gonna be my next direction. It got clear that something wasn't right on the server. Glad you figured it out.]]>
   </description>
   <pubDate>Fri, 06 Jan 2012 04:59:54 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12381#12381</guid>
  </item> 
  <item>
   <title>Link For Authentication :   Figured it out!!I&amp;#039;m using...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12372#12372</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=449" rel="nofollow">smi-mark</a><br /><strong>Subject:</strong> 3193<br /><strong>Posted:</strong> 05-Jan-2012 at 10:21am<br /><br />Figured it out!!<br><br>I'm using a CompositionContextResolver to assign types to the real/fake login manager.<br><br>Both of my LoginManager's have PartNotDiscoverable and then I create the context and pass which one it should use.<br><br>My second model did not know about the LoginManager. Fixed now!<br><br>I noticed this line in the debuglog, which pointed me in the right direction:<br><br>&lt;entry id="92" timestamp="2012-01-05T10:26:34" username="" source="IdeaBlade.EntityModel.Server.SessionManager:GetLoginManager"&gt;No Login Manager found. AllowAnonymousLogin is disabled, no logins will be accepted.&lt;/entry&gt;<br><span style="font-size:10px"><br /><br />Edited by smi-mark - 05-Jan-2012 at 10:27am</span>]]>
   </description>
   <pubDate>Thu, 05 Jan 2012 10:21:44 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12372#12372</guid>
  </item> 
  <item>
   <title>Link For Authentication :  Hi Marcel,I have confirmed that...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12371#12371</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=449" rel="nofollow">smi-mark</a><br /><strong>Subject:</strong> 3193<br /><strong>Posted:</strong> 05-Jan-2012 at 8:35am<br /><br />Hi Marcel,<br><br>I have confirmed that it is indeed being linked, see below screens:<br><br>This is being called from LinkAuthentication in BaseEntityManagerProvider.cs<br><br>This is the Manager that it will be linked to. As you can see, it is logged in and has a principal.<br><br><img src="uploads/449/ib1.png" border="0" /><br><br>This is the target Manager that is going to be linked. As you can see initially it is not logged in and does not have a principal.<br><br><img src="uploads/449/ib2.png" border="0" /><br><br>This is the target Manager immediately after the LinkForAuthentication call. As you can see it is now logged in with a principal.<br><br><img src="uploads/449/ib3.png" border="0" /><br><br><br>I do not have a custom IAuthenticationProvider, and my AuthenticationService only overrides OnLoggedIn and OnLoggedOut to publish an event. <br>]]>
   </description>
   <pubDate>Thu, 05 Jan 2012 08:35:24 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12371#12371</guid>
  </item> 
  <item>
   <title>Link For Authentication :   Mark,Difficult to say what&amp;#039;s...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12370#12370</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3193<br /><strong>Posted:</strong> 05-Jan-2012 at 12:31am<br /><br />Mark,<div>Difficult to say what's going on without seeing some of your code.&nbsp;I can successfully demonstrate that this works under normal circumstances. From your description it's pretty clear that the EntityManager you are calling&nbsp;SaveChanges on&nbsp;is in fact not linked. You could verify this by checking the IsLoggedIn property&nbsp;and/or the Principal property before calling SaveChanges.&nbsp;It should say true and it should&nbsp;return the&nbsp;current&nbsp;principal.&nbsp;Perhaps you can send me your AuthenticationService, so I can see what you have customized. My first hunch is that something is going wrong there. There's also&nbsp;IAuthenticationProvider which DevForce looks for to&nbsp;automatically link EntityManagers that are not linked yet. DAF automatically injects an AuthenticationProvider&nbsp;during&nbsp;configuration if it doesn't already&nbsp;see one in the MEF container.&nbsp;Do you perhaps have your own implementation of IAuthenticationProvider?&nbsp;</div><div>&nbsp;</div><div>Maybe we have to debug this over a WebEx when I'm back in the office next week.</div><div>&nbsp;</div><div>Marcel&nbsp;</div>]]>
   </description>
   <pubDate>Thu, 05 Jan 2012 00:31:27 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12370#12370</guid>
  </item> 
  <item>
   <title>Link For Authentication : I&amp;#039;ve disable AnonymousLogin...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12364#12364</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=449" rel="nofollow">smi-mark</a><br /><strong>Subject:</strong> 3193<br /><strong>Posted:</strong> 04-Jan-2012 at 3:38pm<br /><br />I've disable AnonymousLogin now and I'm getting "Support for Anonymous logins is not enabled." so something is definitely not linking right.<br><br>I am using Marcel's framework as I stated above, so the BaseEntityManagerProvider should be calling LinkAuthentication on my custom AuthenticationService (which it is)<br><br><br>]]>
   </description>
   <pubDate>Wed, 04 Jan 2012 15:38:00 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12364#12364</guid>
  </item> 
  <item>
   <title>Link For Authentication : I have two models, and I&amp;#039;m...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12363#12363</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=449" rel="nofollow">smi-mark</a><br /><strong>Subject:</strong> 3193<br /><strong>Posted:</strong> 04-Jan-2012 at 3:29pm<br /><br />I have two models, and I'm using LinkForAuthentication using the AuthenticationService in the DevForce Application Framework.<br><br>I have confirmed link is being called, but when my EntityServerSaveInterceptor is being called on the server, for the second model, the principal is showing anonymous, and not the correct one. Any suggestions?<br>]]>
   </description>
   <pubDate>Wed, 04 Jan 2012 15:29:51 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3193&amp;PID=12363#12363</guid>
  </item> 
 </channel>
</rss>