fix
This commit is contained in:
parent
2bd66c7925
commit
9bf66b97c4
@ -20,8 +20,7 @@ namespace UniversityDataBaseImplemet.Implements
|
|||||||
{
|
{
|
||||||
using var context = new Database();
|
using var context = new Database();
|
||||||
var user = context.User
|
var user = context.User
|
||||||
.Include(record => record.Login)
|
.Include(record => record.Role)
|
||||||
.Include(record => record.RoleId)
|
|
||||||
.FirstOrDefault(record => record.Id.Equals(model.Id));
|
.FirstOrDefault(record => record.Id.Equals(model.Id));
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
@ -40,8 +39,7 @@ namespace UniversityDataBaseImplemet.Implements
|
|||||||
}
|
}
|
||||||
using var context = new Database();
|
using var context = new Database();
|
||||||
return context.User
|
return context.User
|
||||||
.Include(record => record.Login)
|
.Include(record => record.Role)
|
||||||
.Include(record => record.Id)
|
|
||||||
.FirstOrDefault(record => record.Id.Equals(model.Id))
|
.FirstOrDefault(record => record.Id.Equals(model.Id))
|
||||||
?.GetViewModel;
|
?.GetViewModel;
|
||||||
}
|
}
|
||||||
@ -52,8 +50,7 @@ namespace UniversityDataBaseImplemet.Implements
|
|||||||
if (model.Id.HasValue)
|
if (model.Id.HasValue)
|
||||||
{
|
{
|
||||||
return context.User
|
return context.User
|
||||||
.Include(record => record.Login)
|
.Include(record => record.Role)
|
||||||
.Include(record => record.RoleId)
|
|
||||||
.Where(record => record.Id.Equals(model.Id))
|
.Where(record => record.Id.Equals(model.Id))
|
||||||
.Select(record => record.GetViewModel)
|
.Select(record => record.GetViewModel)
|
||||||
.ToList();
|
.ToList();
|
||||||
@ -65,8 +62,7 @@ namespace UniversityDataBaseImplemet.Implements
|
|||||||
{
|
{
|
||||||
using var context = new Database();
|
using var context = new Database();
|
||||||
return context.User
|
return context.User
|
||||||
.Include(record => record.Login)
|
.Include(record => record.Role)
|
||||||
.Include(record => record.RoleId)
|
|
||||||
.Select(record => record.GetViewModel)
|
.Select(record => record.GetViewModel)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
@ -91,8 +87,7 @@ namespace UniversityDataBaseImplemet.Implements
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var user = context.User
|
var user = context.User
|
||||||
.Include(record => record.Login)
|
.Include(record => record.Role)
|
||||||
.Include(record => record.RoleId)
|
|
||||||
.FirstOrDefault(record => record.Id.Equals(model.Id));
|
.FirstOrDefault(record => record.Id.Equals(model.Id));
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user