From 58063233d7aadc4d60bf41f7e97b165987506fe6 Mon Sep 17 00:00:00 2001 From: GokaPek Date: Mon, 27 May 2024 22:35:15 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UniversityDatabase.cs | 2 +- .../UniversityRestApi/Controllers/UserController.cs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/University/UniversityDatabaseImplement/UniversityDatabase.cs b/University/UniversityDatabaseImplement/UniversityDatabase.cs index 2b73bad..07213d0 100644 --- a/University/UniversityDatabaseImplement/UniversityDatabase.cs +++ b/University/UniversityDatabaseImplement/UniversityDatabase.cs @@ -11,7 +11,7 @@ namespace UniversityDatabaseImplement if (optionsBuilder.IsConfigured == false) { //Возможно понадобится писать вместо (localdb) название пк, вот пк Егора: DESKTOP-N8BRIPR; other-name: LAPTOP-DYCTATOR; other-name: DyCTaTOR - optionsBuilder.UseSqlServer(@"Data Source=DyCTaTOR\SQLEXPRESS;Initial Catalog=UniversityDatabaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); + optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-N8BRIPR\SQLEXPRESS;Initial Catalog=UniversityDatabaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); } base.OnConfiguring(optionsBuilder); } diff --git a/University/UniversityRestApi/Controllers/UserController.cs b/University/UniversityRestApi/Controllers/UserController.cs index 5bc8a2d..5374327 100644 --- a/University/UniversityRestApi/Controllers/UserController.cs +++ b/University/UniversityRestApi/Controllers/UserController.cs @@ -68,6 +68,19 @@ namespace UniversityRestApi.Controllers throw; } } + [HttpGet] + public List? GetAll() + { + try + { + return _logic.ReadList(null); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка"); + throw; + } + } [HttpPost] public void RegisterWorker(UserBindingModel model) {