Skip to content
This repository has been archived by the owner on May 1, 2019. It is now read-only.

Commit

Permalink
Updated vanilla implementation to be multi-tenant
Browse files Browse the repository at this point in the history
  • Loading branch information
JSkimming committed Nov 26, 2013
1 parent 4e7a36e commit 2360ea5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Web;
using System.Web.Mvc;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using AspNet.Identity.EntityFramework.Multitenant;
using Microsoft.Owin.Security;
using VanillaImplementation.Models;

Expand All @@ -16,7 +16,7 @@ namespace VanillaImplementation.Controllers
public class AccountController : Controller
{
public AccountController()
: this(new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext())))
: this(new UserManager<ApplicationUser>(new MultitenantUserStore<ApplicationUser>(new ApplicationDbContext()) { TenantId = "TestTenant" }))
{
}

Expand Down
6 changes: 3 additions & 3 deletions src/Examples/VanillaImplementation/Models/IdentityModels.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using Microsoft.AspNet.Identity.EntityFramework;
using AspNet.Identity.EntityFramework.Multitenant;

namespace VanillaImplementation.Models
{
// You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
public class ApplicationUser : IdentityUser
public class ApplicationUser : MultitenantIdentityUser
{
}

public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
public class ApplicationDbContext : MultitenantIdentityDbContext<ApplicationUser>
{
public ApplicationDbContext()
: base("DefaultConnection")
Expand Down
10 changes: 8 additions & 2 deletions src/Examples/VanillaImplementation/VanillaImplementation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.AspNet.Identity.Core">
<HintPath>..\..\packages\Microsoft.AspNet.Identity.Core.1.0.0\lib\net45\Microsoft.AspNet.Identity.Core.dll</HintPath>
<HintPath>..\..\packages\Microsoft.AspNet.Identity.Core.1.1.0-alpha1-131122\lib\net45\Microsoft.AspNet.Identity.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNet.Identity.Owin">
<HintPath>..\..\packages\Microsoft.AspNet.Identity.Owin.1.0.0\lib\net45\Microsoft.AspNet.Identity.Owin.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNet.Identity.EntityFramework">
<HintPath>..\..\packages\Microsoft.AspNet.Identity.EntityFramework.1.0.0\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll</HintPath>
<HintPath>..\..\packages\Microsoft.AspNet.Identity.EntityFramework.1.1.0-alpha1-131122\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll</HintPath>
</Reference>
<Reference Include="Owin">
<HintPath>..\..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
Expand Down Expand Up @@ -242,6 +242,12 @@
<Content Include="packages.config" />
<None Include="Project_Readme.html" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\AspNet.Identity.EntityFramework.Multitenant\AspNet.Identity.EntityFramework.Multitenant.csproj">
<Project>{ec024226-3fe4-4283-bd11-44987d082295}</Project>
<Name>AspNet.Identity.EntityFramework.Multitenant</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down
4 changes: 2 additions & 2 deletions src/Examples/VanillaImplementation/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<package id="EntityFramework" version="6.0.1" targetFramework="net45" />
<package id="jQuery" version="2.0.3" targetFramework="net45" />
<package id="jQuery.Validation" version="1.11.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Identity.Core" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Identity.EntityFramework" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Identity.Core" version="1.1.0-alpha1-131122" targetFramework="net45" />
<package id="Microsoft.AspNet.Identity.EntityFramework" version="1.1.0-alpha1-131122" targetFramework="net45" />
<package id="Microsoft.AspNet.Identity.Owin" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="5.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net45" />
Expand Down

0 comments on commit 2360ea5

Please sign in to comment.