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