This repository has been archived by the owner on May 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
/
MultitenantIdentityUser.cs
44 lines (40 loc) · 1.65 KB
/
MultitenantIdentityUser.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//-----------------------------------------------------------------------
// <copyright company="James Skimming">
// Copyright (c) 2013 James Skimming
// </copyright>
//-----------------------------------------------------------------------
namespace AspNet.Identity.EntityFramework.Multitenant
{
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
/// <summary>
/// Minimal class for a <see cref="MultitenantIdentityUser{TKey, TTenantKey, TLogin, TRole, TClaim}"/> with a
/// <see cref="string"/> user <see cref="IUser{TKey}.Id"/> and
/// <see cref="MultitenantIdentityUserLogin{TKey, TTenant}.TenantId"/>.
/// </summary>
public class MultitenantIdentityUser :
MultitenantIdentityUser<string, string, MultitenantIdentityUserLogin, IdentityUserRole, IdentityUserClaim>
{
/// <summary>
/// Initializes a new instance of the <see cref="MultitenantIdentityUser"/> class.
/// </summary>
public MultitenantIdentityUser()
{
Id = Guid.NewGuid().ToString();
}
/// <summary>
/// Initializes a new instance of the <see cref="MultitenantIdentityUser"/> class.
/// </summary>
/// <param name="userName">The <see cref="IdentityUser{TKey, TLogin, TRole, TClaim}.UserName"/> of the user.</param>
public MultitenantIdentityUser(string userName)
: this()
{
if (string.IsNullOrWhiteSpace(userName))
throw new ArgumentNullException("userName");
UserName = userName;
}
}
}