From 0c5cb4e1219f8bf97fc53442330fe3dc190c94c6 Mon Sep 17 00:00:00 2001 From: DyCTaTOR <125912249+DyCTaTOR@users.noreply.github.com> Date: Mon, 27 May 2024 21:26:21 +0400 Subject: [PATCH] =?UTF-8?q?=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implements/StudentStorage.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/University/UniversityDatabaseImplement/Implements/StudentStorage.cs b/University/UniversityDatabaseImplement/Implements/StudentStorage.cs index a56480c..8ecad2e 100644 --- a/University/UniversityDatabaseImplement/Implements/StudentStorage.cs +++ b/University/UniversityDatabaseImplement/Implements/StudentStorage.cs @@ -1,4 +1,5 @@ -using System; +using Microsoft.EntityFrameworkCore; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; @@ -31,7 +32,12 @@ namespace UniversityDatabaseImplement.Implements using var context = new UniversityDatabase(); - return context.Students.Where(x => x.Name.Contains(model.Name)).Select(x => x.GetViewModel).ToList(); + return context.Students + .Include(x => x.User) + .Where(x => x.Name + .Contains(model.Name)) + .Select(x => x.GetViewModel) + .ToList(); } public StudentViewModel? GetElement(StudentSearchModel model)