Integrated AuthenticationStateProvider using .NET Core Identity
This commit is contained in:
@ -9,6 +9,7 @@ namespace Oqtane.Repository
|
||||
void AddUser(User User);
|
||||
void UpdateUser(User User);
|
||||
User GetUser(int UserId);
|
||||
User GetUser(string Username);
|
||||
void DeleteUser(int UserId);
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,12 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Oqtane.Models;
|
||||
using System;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public class TenantContext : DbContext
|
||||
public class TenantContext : IdentityDbContext<IdentityUser>
|
||||
{
|
||||
public virtual DbSet<Site> Site { get; set; }
|
||||
public virtual DbSet<Page> Page { get; set; }
|
||||
|
@ -28,6 +28,10 @@ namespace Oqtane.Repository
|
||||
{
|
||||
aliasname += "/" + segments[1];
|
||||
}
|
||||
if (aliasname.EndsWith("/"))
|
||||
{
|
||||
aliasname = aliasname.Substring(0, aliasname.Length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
public Tenant GetTenant()
|
||||
|
@ -65,6 +65,19 @@ namespace Oqtane.Repository
|
||||
}
|
||||
}
|
||||
|
||||
public User GetUser(string Username)
|
||||
{
|
||||
try
|
||||
{
|
||||
User user = db.User.Where(item => item.Username == Username).FirstOrDefault();
|
||||
return user;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteUser(int userId)
|
||||
{
|
||||
try
|
||||
|
Reference in New Issue
Block a user