From eaf822519c4b7145c65755e70b489e96b4063e9b Mon Sep 17 00:00:00 2001 From: asakky Date: Wed, 25 Dec 2024 19:10:14 +0400 Subject: [PATCH] done<3 --- .../ProjectLibrary/Entities/Book.cs | 4 ++ .../ProjectLibrary/Entities/BookIssue.cs | 2 + .../Entities/BookRestoration.cs | 13 +++++ .../ProjectLibrary/Entities/Issue.cs | 32 +++++++---- .../ProjectLibrary/Entities/Librarian.cs | 3 ++ .../ProjectLibrary/Entities/Reader.cs | 4 ++ .../ProjectLibrary/Entities/TempBookIssue.cs | 26 --------- .../Forms/FormBookRestorations.cs | 6 ++- .../ProjectLibrary/Forms/FormBooks.cs | 6 ++- .../ProjectLibrary/Forms/FormIssues.cs | 7 ++- .../ProjectLibrary/Forms/FormLibrarians.cs | 7 ++- .../ProjectLibrary/Forms/FormReaders.cs | 6 ++- .../ProjectLibrary/Reports/ChartReport.cs | 3 +- .../ProjectLibrary/Reports/TableReport.cs | 8 +-- .../IBookRestorationRepository.cs | 2 +- .../Repositories/IIssueRepository.cs | 2 +- .../BookRestorationRepository.cs | 22 ++++++-- .../Implementations/IssueRepository.cs | 53 ++++++++++++++++--- .../Implementations/QueryBuilder.cs | 34 ++++++++++++ .../ProjectLibrary/library_log20241225.txt | 51 ++++++++++++++++++ 20 files changed, 228 insertions(+), 63 deletions(-) delete mode 100644 ProjectLibrary/ProjectLibrary/Entities/TempBookIssue.cs create mode 100644 ProjectLibrary/ProjectLibrary/Repositories/Implementations/QueryBuilder.cs create mode 100644 ProjectLibrary/ProjectLibrary/library_log20241225.txt diff --git a/ProjectLibrary/ProjectLibrary/Entities/Book.cs b/ProjectLibrary/ProjectLibrary/Entities/Book.cs index 588b64c..735e38d 100644 --- a/ProjectLibrary/ProjectLibrary/Entities/Book.cs +++ b/ProjectLibrary/ProjectLibrary/Entities/Book.cs @@ -1,6 +1,7 @@ using ProjectLibrary.Entities.Enums; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -11,10 +12,13 @@ public class Book { public int Id { get; private set; } + [DisplayName("Название")] public string Title { get; private set; } = string.Empty; + [DisplayName("Жанр")] public BookTopic Topic { get; private set; } + [DisplayName("Вернули?")] public Boolean IsIssued { get; private set; } public static Book CreateEntity(int id, string title, BookTopic topic, Boolean isIssued) diff --git a/ProjectLibrary/ProjectLibrary/Entities/BookIssue.cs b/ProjectLibrary/ProjectLibrary/Entities/BookIssue.cs index 47e5a59..596d3be 100644 --- a/ProjectLibrary/ProjectLibrary/Entities/BookIssue.cs +++ b/ProjectLibrary/ProjectLibrary/Entities/BookIssue.cs @@ -14,6 +14,8 @@ public class BookIssue public int BookId { get;private set; } + public string BookName { get; private set; } = string.Empty; + public static BookIssue CreateElement(int id, string description, int bookId) { return new BookIssue diff --git a/ProjectLibrary/ProjectLibrary/Entities/BookRestoration.cs b/ProjectLibrary/ProjectLibrary/Entities/BookRestoration.cs index eba90e4..52449f9 100644 --- a/ProjectLibrary/ProjectLibrary/Entities/BookRestoration.cs +++ b/ProjectLibrary/ProjectLibrary/Entities/BookRestoration.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -9,11 +10,23 @@ namespace ProjectLibrary.Entities; public class BookRestoration { public int Id { get; private set; } + + [Browsable(false)] public int LibrarianId { get; private set; } + + [Browsable(false)] public int BookId { get; private set; } + [DisplayName("Книга")] + public string BookName { get; private set; } = string.Empty; + + [DisplayName("Сотрудник")] + public string LibrarianName { get; private set; } = string.Empty; + + [DisplayName("Дата реставрации")] public DateTime RestorationDate { get; private set; } + [DisplayName("Описание")] public string Description { get; private set; } = string.Empty; public static BookRestoration CreateOperation(int id, int librarianId, int bookId, DateTime restorationDate, string description) diff --git a/ProjectLibrary/ProjectLibrary/Entities/Issue.cs b/ProjectLibrary/ProjectLibrary/Entities/Issue.cs index 931f89d..832271b 100644 --- a/ProjectLibrary/ProjectLibrary/Entities/Issue.cs +++ b/ProjectLibrary/ProjectLibrary/Entities/Issue.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -10,18 +11,35 @@ public class Issue { public int Id { get; private set; } + [DisplayName("Дата выпуска")] public DateTime IssueDate { get; private set; } + [DisplayName("Срок")] public DateTime DueDate { get; private set; } + [DisplayName("Дата возврата")] public DateTime ReturnDate { get; private set; } + [Browsable(false)] public int LibrarianId { get; private set;} + [DisplayName("Имя сотрудника")] + public string LibrarianName { get; private set; } = string.Empty; + + [Browsable(false)] public int ReaderId { get; private set; } + [DisplayName("Имя клиента")] + public string ReaderName { get; private set; } = string.Empty; + + [Browsable(false)] public IEnumerable BookIssue { get; private set; } = []; + [DisplayName("Выданные книги")] + public string Books => BookIssue != null ? + string.Join(", ", BookIssue.Select(x => $"{x.BookName}")) : + string.Empty; + public static Issue CreateOperation(int id, DateTime issueDate, DateTime dueDate, DateTime returnDate, int librarianId, int readerId, IEnumerable bookIssue) { return new Issue @@ -36,17 +54,11 @@ public class Issue }; } - public static Issue CreateOperation(TempBookIssue tempBookIssue, IEnumerable bookIssue) + public void SetBookIssue(IEnumerable bookIssue) { - return new Issue + if (bookIssue != null && bookIssue.Any()) { - Id = tempBookIssue.Id, - IssueDate = tempBookIssue.IssueDate, - DueDate = tempBookIssue.DueDate, - ReturnDate = tempBookIssue.ReturnDate, - LibrarianId = tempBookIssue.LibrarianId, - ReaderId = tempBookIssue.ReaderId, - BookIssue = bookIssue - }; + BookIssue = bookIssue; + } } } diff --git a/ProjectLibrary/ProjectLibrary/Entities/Librarian.cs b/ProjectLibrary/ProjectLibrary/Entities/Librarian.cs index 1d78a44..b8471e7 100644 --- a/ProjectLibrary/ProjectLibrary/Entities/Librarian.cs +++ b/ProjectLibrary/ProjectLibrary/Entities/Librarian.cs @@ -2,6 +2,7 @@ using ProjectLibrary.Entities.Enums; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -12,8 +13,10 @@ public class Librarian { public int Id { get; private set; } + [DisplayName("Имя")] public string Name { get; private set; } = string.Empty; + [DisplayName("Тип")] public AllowedTopic AllowedTopic { get; private set; } public static Librarian CreateEntity(int id, string name, AllowedTopic allowedTopic) diff --git a/ProjectLibrary/ProjectLibrary/Entities/Reader.cs b/ProjectLibrary/ProjectLibrary/Entities/Reader.cs index 8f84a3d..c6868c1 100644 --- a/ProjectLibrary/ProjectLibrary/Entities/Reader.cs +++ b/ProjectLibrary/ProjectLibrary/Entities/Reader.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -10,10 +11,13 @@ public class Reader { public int Id { get; private set; } + [DisplayName("Имя")] public string Name { get; private set; } = string.Empty; + [DisplayName("Читательский билет")] public int LibraryCard { get; private set; } + [DisplayName("До какого выдан")] public DateTime CardValidity { get; private set; } public static Reader CreateEntity(int id, string name, int libraryCard) diff --git a/ProjectLibrary/ProjectLibrary/Entities/TempBookIssue.cs b/ProjectLibrary/ProjectLibrary/Entities/TempBookIssue.cs deleted file mode 100644 index 9e897a5..0000000 --- a/ProjectLibrary/ProjectLibrary/Entities/TempBookIssue.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ProjectLibrary.Entities; - -public class TempBookIssue -{ - public int Id { get; private set; } - - public DateTime IssueDate { get; private set; } - - public DateTime DueDate { get; private set; } - - public DateTime ReturnDate { get; private set; } - - public int LibrarianId { get; private set; } - - public int ReaderId { get; private set; } - - public string Description { get; private set; } = string.Empty; - - public int BookId { get; private set; } -} diff --git a/ProjectLibrary/ProjectLibrary/Forms/FormBookRestorations.cs b/ProjectLibrary/ProjectLibrary/Forms/FormBookRestorations.cs index 91d1ee4..4890977 100644 --- a/ProjectLibrary/ProjectLibrary/Forms/FormBookRestorations.cs +++ b/ProjectLibrary/ProjectLibrary/Forms/FormBookRestorations.cs @@ -75,7 +75,11 @@ namespace ProjectLibrary.Forms MessageBoxButtons.OK, MessageBoxIcon.Error); } } - private void LoadList() => dataGridView.DataSource = _bookRestorationRepository.ReadBookRestorations(); + private void LoadList() + { + dataGridView.DataSource = _bookRestorationRepository.ReadBookRestorations(); + dataGridView.Columns["Id"].Visible = false; + } private bool TryGetIdentifierFromSelectedRow(out int id) { id = 0; diff --git a/ProjectLibrary/ProjectLibrary/Forms/FormBooks.cs b/ProjectLibrary/ProjectLibrary/Forms/FormBooks.cs index 6e8b2f7..62d9976 100644 --- a/ProjectLibrary/ProjectLibrary/Forms/FormBooks.cs +++ b/ProjectLibrary/ProjectLibrary/Forms/FormBooks.cs @@ -97,7 +97,11 @@ namespace ProjectLibrary.Forms } } - private void LoadList() => dataGridView.DataSource = _bookRepository.ReadBooks(); + private void LoadList() + { + dataGridView.DataSource = _bookRepository.ReadBooks(); + dataGridView.Columns["Id"].Visible = false; + } private bool TryGetIdentifierFromSelectedRow(out int id) { id = 0; diff --git a/ProjectLibrary/ProjectLibrary/Forms/FormIssues.cs b/ProjectLibrary/ProjectLibrary/Forms/FormIssues.cs index 71840fa..d0e2a56 100644 --- a/ProjectLibrary/ProjectLibrary/Forms/FormIssues.cs +++ b/ProjectLibrary/ProjectLibrary/Forms/FormIssues.cs @@ -76,8 +76,11 @@ namespace ProjectLibrary.Forms } } - private void LoadList() => dataGridView.DataSource = _issueRepository.ReadIssue(); - + private void LoadList() + { + dataGridView.DataSource = _issueRepository.ReadIssue(); + dataGridView.Columns["Id"].Visible = false; + } private bool TryGetIdentifierFromSelectedRow(out int id) { id = 0; diff --git a/ProjectLibrary/ProjectLibrary/Forms/FormLibrarians.cs b/ProjectLibrary/ProjectLibrary/Forms/FormLibrarians.cs index 3bacb2b..e6bb0c7 100644 --- a/ProjectLibrary/ProjectLibrary/Forms/FormLibrarians.cs +++ b/ProjectLibrary/ProjectLibrary/Forms/FormLibrarians.cs @@ -94,8 +94,11 @@ namespace ProjectLibrary.Forms } } - private void LoadList() => dataGridView.DataSource = _librarianRepository.ReadLibrarians(); - + private void LoadList() + { + dataGridView.DataSource = _librarianRepository.ReadLibrarians(); + dataGridView.Columns["Id"].Visible = false; + } private bool TryGetIdentifierFromSelectedRow(out int id) { id = 0; diff --git a/ProjectLibrary/ProjectLibrary/Forms/FormReaders.cs b/ProjectLibrary/ProjectLibrary/Forms/FormReaders.cs index 6e88bf7..7337cfb 100644 --- a/ProjectLibrary/ProjectLibrary/Forms/FormReaders.cs +++ b/ProjectLibrary/ProjectLibrary/Forms/FormReaders.cs @@ -94,7 +94,11 @@ namespace ProjectLibrary.Forms MessageBoxButtons.OK, MessageBoxIcon.Error); } } - private void LoadList() => dataGridView.DataSource = _readerRepository.ReadReaders(); + private void LoadList() + { + dataGridView.DataSource = _readerRepository.ReadReaders(); + dataGridView.Columns["Id"].Visible = false; + } private bool TryGetIdentifierFromSelectedRow(out int id) { id = 0; diff --git a/ProjectLibrary/ProjectLibrary/Reports/ChartReport.cs b/ProjectLibrary/ProjectLibrary/Reports/ChartReport.cs index 6d2bcbd..07e8ece 100644 --- a/ProjectLibrary/ProjectLibrary/Reports/ChartReport.cs +++ b/ProjectLibrary/ProjectLibrary/Reports/ChartReport.cs @@ -35,8 +35,7 @@ internal class ChartReport private List<(string Caption, double Value)> GetData(DateTime dateTime) { var issueCount = _issueRepository - .ReadIssue() - .Where(x => x.IssueDate.Date == dateTime.Date) + .ReadIssue(dateFrom: dateTime.Date, dateTo: dateTime.Date.AddDays(1)) .SelectMany(x => x.BookIssue) .Count(); diff --git a/ProjectLibrary/ProjectLibrary/Reports/TableReport.cs b/ProjectLibrary/ProjectLibrary/Reports/TableReport.cs index 573fb67..dcd0059 100644 --- a/ProjectLibrary/ProjectLibrary/Reports/TableReport.cs +++ b/ProjectLibrary/ProjectLibrary/Reports/TableReport.cs @@ -53,9 +53,7 @@ internal class TableReport var librarianId = librarian.Id; - var issueData = _issueRepository.ReadIssue() - .Where(issue => issue.IssueDate >= startDate && issue.IssueDate <= endDate) - .Where(issue => issue.LibrarianId == librarianId) + var issueData = _issueRepository.ReadIssue(librarianId, startDate, endDate) .SelectMany(issue => issue.BookIssue, (issue, bookIssue) => new { Librarian = librarian.Name, @@ -65,9 +63,7 @@ internal class TableReport }); - var restorationData = _bookRestorationRepository.ReadBookRestorations() - .Where(restoration => restoration.RestorationDate >= startDate && restoration.RestorationDate <= endDate) - .Where(restoration => restoration.LibrarianId == librarianId) + var restorationData = _bookRestorationRepository.ReadBookRestorations(librarianId, startDate, endDate) .GroupBy(restoration => new { restoration.RestorationDate, diff --git a/ProjectLibrary/ProjectLibrary/Repositories/IBookRestorationRepository.cs b/ProjectLibrary/ProjectLibrary/Repositories/IBookRestorationRepository.cs index 682a31b..21ae3d2 100644 --- a/ProjectLibrary/ProjectLibrary/Repositories/IBookRestorationRepository.cs +++ b/ProjectLibrary/ProjectLibrary/Repositories/IBookRestorationRepository.cs @@ -9,7 +9,7 @@ namespace ProjectLibrary.Repositories; public interface IBookRestorationRepository { - IEnumerable ReadBookRestorations(int? id = null, int? librarianId = null, int? bookId=null, string? description = null, DateTime? dateFrom = null, DateTime? dateTo = null); + IEnumerable ReadBookRestorations(int? librarianId = null, DateTime? dateFrom = null, DateTime? dateTo = null); void CreateBookRestoration(BookRestoration bookRestoration); diff --git a/ProjectLibrary/ProjectLibrary/Repositories/IIssueRepository.cs b/ProjectLibrary/ProjectLibrary/Repositories/IIssueRepository.cs index 8204a88..f2698cf 100644 --- a/ProjectLibrary/ProjectLibrary/Repositories/IIssueRepository.cs +++ b/ProjectLibrary/ProjectLibrary/Repositories/IIssueRepository.cs @@ -9,7 +9,7 @@ namespace ProjectLibrary.Repositories; public interface IIssueRepository { - IEnumerable ReadIssue(int? id=null, int? librarianId = null, int? readerId = null, DateTime? dateFrom = null, DateTime? dateTo = null); + IEnumerable ReadIssue(int? librarianId = null, DateTime? dateFrom = null, DateTime? dateTo = null); void CreateIssue(Issue issue); diff --git a/ProjectLibrary/ProjectLibrary/Repositories/Implementations/BookRestorationRepository.cs b/ProjectLibrary/ProjectLibrary/Repositories/Implementations/BookRestorationRepository.cs index 3c68ed8..5504e26 100644 --- a/ProjectLibrary/ProjectLibrary/Repositories/Implementations/BookRestorationRepository.cs +++ b/ProjectLibrary/ProjectLibrary/Repositories/Implementations/BookRestorationRepository.cs @@ -66,16 +66,32 @@ public class BookRestorationRepository : IBookRestorationRepository } } - public IEnumerable ReadBookRestorations(int? id, int? librarianId, int? bookId, string? description, DateTime? dateFrom = null, DateTime? dateTo = null) + public IEnumerable ReadBookRestorations(int? librarianId, DateTime? dateFrom = null, DateTime? dateTo = null) { _logger.LogInformation("Получение всех объектов"); try { + var builder = new QueryBuilder(); + if (dateFrom.HasValue) + { + builder.AddCondition("bor.RestorationDate >= @dateFrom"); + } + if (dateTo.HasValue) + { + builder.AddCondition("bor.RestorationDate <= @dateTo"); + } + if (librarianId.HasValue) + { + builder.AddCondition("bor.librarianId = @librarianId"); + } using var connection = new NpgsqlConnection(_connectionString.ConnectionString); - var querySelect = "SELECT * FROM BookRestoration"; + var querySelect = @$"SELECT bor.*, boo.Title as BookName, lib.Name as LibrarianName FROM BookRestoration bor + LEFT JOIN Book boo on boo.Id = bor.BookId + LEFT JOIN Librarian lib on lib.Id = bor.LibrarianId + {builder.Build()}"; var bookRestoration = - connection.Query(querySelect); + connection.Query(querySelect, new {dateFrom, dateTo, librarianId}); _logger.LogDebug("Полученные объекты: {json}", JsonConvert.SerializeObject(bookRestoration)); return bookRestoration; diff --git a/ProjectLibrary/ProjectLibrary/Repositories/Implementations/IssueRepository.cs b/ProjectLibrary/ProjectLibrary/Repositories/Implementations/IssueRepository.cs index b91c02b..ad04be4 100644 --- a/ProjectLibrary/ProjectLibrary/Repositories/Implementations/IssueRepository.cs +++ b/ProjectLibrary/ProjectLibrary/Repositories/Implementations/IssueRepository.cs @@ -89,22 +89,61 @@ public class IssueRepository : IIssueRepository } } - public IEnumerable ReadIssue(int? id, int? librarianId, int? readerId, DateTime? dateFrom = null, DateTime? dateTo = null) + public IEnumerable ReadIssue(int? librarianId, DateTime? dateFrom = null, DateTime? dateTo = null) { _logger.LogInformation("Получение всех объектов"); try { + var builder = new QueryBuilder(); + if (dateFrom.HasValue) + { + builder.AddCondition("iss.IssueDate >= @dateFrom"); + } + if (dateTo.HasValue) + { + builder.AddCondition("iss.IssueDate <= @dateTo"); + } + if (librarianId.HasValue) + { + builder.AddCondition("iss.librarianId = @librarianId"); + } using var connection = new NpgsqlConnection(_connectionString.ConnectionString); var querySelect = @"SELECT - iss.*, biss.Description, biss.BookId + iss.*, + lib.Name as LibrarianName, + rea.Name as ReaderName, + biss.Description, + biss.BookId, + bo.Title as BookName FROM Issue iss - INNER JOIN Book_Issue biss on biss.IssueId = iss.Id"; - var issue = - connection.Query(querySelect); + LEFT JOIN Librarian lib on lib.Id = iss.LibrarianId + LEFT JOIN Reader rea on rea.Id = iss.ReaderId + INNER JOIN Book_Issue biss on biss.IssueId = iss.Id + LEFT JOIN Book bo on bo.Id = biss.BookId"; + var issuesDict = new Dictionary>(); + + var bookIssues = connection.Query(querySelect, + (issue, bookIssue) => + { + if (!issuesDict.TryGetValue(issue.Id, out var ccf)) + { + ccf = []; + issuesDict.Add(issue.Id, ccf); + } + + ccf.Add(bookIssue); + return issue; + }, splitOn: "BookId", param: new { dateFrom, dateTo, librarianId }); _logger.LogDebug("Полученные объекты: {json}", - JsonConvert.SerializeObject(issue)); - return issue.GroupBy(x => x.Id, y => y, (key, value) => Issue.CreateOperation(value.First(), value.Select(z => BookIssue.CreateElement(0, z.Description, z.BookId)))).ToList(); + JsonConvert.SerializeObject(bookIssues)); + + return issuesDict.Select(x => + { + var cf = bookIssues.First(y => y.Id == x.Key); + cf.SetBookIssue(x.Value); + return cf; + }).ToArray(); } catch (Exception ex) { diff --git a/ProjectLibrary/ProjectLibrary/Repositories/Implementations/QueryBuilder.cs b/ProjectLibrary/ProjectLibrary/Repositories/Implementations/QueryBuilder.cs new file mode 100644 index 0000000..fc4ec73 --- /dev/null +++ b/ProjectLibrary/ProjectLibrary/Repositories/Implementations/QueryBuilder.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectLibrary.Repositories.Implementations; + +internal class QueryBuilder +{ + private readonly StringBuilder _builder; + public QueryBuilder() + { + _builder = new(); + } + public QueryBuilder AddCondition(string condition) + { + if (_builder.Length > 0) + { + _builder.Append(" AND "); + } + _builder.Append(condition); + return this; + } + public string Build() + { + if (_builder.Length == 0) + { + return string.Empty; + } + return $"WHERE {_builder}"; + } +} + diff --git a/ProjectLibrary/ProjectLibrary/library_log20241225.txt b/ProjectLibrary/ProjectLibrary/library_log20241225.txt new file mode 100644 index 0000000..92c6696 --- /dev/null +++ b/ProjectLibrary/ProjectLibrary/library_log20241225.txt @@ -0,0 +1,51 @@ +2024-12-25 19:09:51.773 +04:00 [INF] Получение всех объектов +2024-12-25 19:09:52.186 +04:00 [ERR] Ошибка при чтении объектов +Npgsql.PostgresException (0x80004005): 28P01: ������������ "postgres" �� ������ �������� ����������� (�� ������) + at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage) + at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) + at Npgsql.Internal.NpgsqlConnector.AuthenticateSASL(List`1 mechanisms, String username, Boolean async, CancellationToken cancellationToken) + at Npgsql.Internal.NpgsqlConnector.Authenticate(String username, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken) + at Npgsql.Internal.NpgsqlConnector.g__OpenCore|214_1(NpgsqlConnector conn, SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken) + at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken) + at Npgsql.PoolingDataSource.OpenNewConnector(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken) + at Npgsql.PoolingDataSource.g__RentAsync|33_0(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken) + at Npgsql.NpgsqlConnection.g__OpenAsync|42_0(Boolean async, CancellationToken cancellationToken) + at Npgsql.NpgsqlConnection.Open() + at Dapper.SqlMapper.MultiMapImpl[TFirst,TSecond,TThird,TFourth,TFifth,TSixth,TSeventh,TReturn](IDbConnection cnn, CommandDefinition command, Delegate map, String splitOn, DbDataReader reader, Identity identity, Boolean finalize)+MoveNext() in /_/Dapper/SqlMapper.cs:line 1566 + at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) + at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) + at Dapper.SqlMapper.MultiMap[TFirst,TSecond,TThird,TFourth,TFifth,TSixth,TSeventh,TReturn](IDbConnection cnn, String sql, Delegate map, Object param, IDbTransaction transaction, Boolean buffered, String splitOn, Nullable`1 commandTimeout, Nullable`1 commandType) in /_/Dapper/SqlMapper.cs:line 1548 + at Dapper.SqlMapper.Query[TFirst,TSecond,TReturn](IDbConnection cnn, String sql, Func`3 map, Object param, IDbTransaction transaction, Boolean buffered, String splitOn, Nullable`1 commandTimeout, Nullable`1 commandType) in /_/Dapper/SqlMapper.cs:line 1397 + at ProjectLibrary.Repositories.Implementations.IssueRepository.ReadIssue(Nullable`1 librarianId, Nullable`1 dateFrom, Nullable`1 dateTo) in F:\OTP2\ProjectLibrary\ProjectLibrary\Repositories\Implementations\IssueRepository.cs:line 126 + Exception data: + Severity: ����� + SqlState: 28P01 + MessageText: ������������ "postgres" �� ������ �������� ����������� (�� ������) + File: auth.c + Line: 324 + Routine: auth_failed +2024-12-25 19:09:55.412 +04:00 [INF] Получение всех объектов +2024-12-25 19:09:55.437 +04:00 [ERR] Ошибка при чтении объектов +Npgsql.PostgresException (0x80004005): 28P01: ������������ "postgres" �� ������ �������� ����������� (�� ������) + at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage) + at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) + at Npgsql.Internal.NpgsqlConnector.AuthenticateSASL(List`1 mechanisms, String username, Boolean async, CancellationToken cancellationToken) + at Npgsql.Internal.NpgsqlConnector.Authenticate(String username, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken) + at Npgsql.Internal.NpgsqlConnector.g__OpenCore|214_1(NpgsqlConnector conn, SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken) + at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken) + at Npgsql.PoolingDataSource.OpenNewConnector(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken) + at Npgsql.PoolingDataSource.g__RentAsync|33_0(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken) + at Npgsql.NpgsqlConnection.g__OpenAsync|42_0(Boolean async, CancellationToken cancellationToken) + at Npgsql.NpgsqlConnection.Open() + at Dapper.SqlMapper.QueryImpl[T](IDbConnection cnn, CommandDefinition command, Type effectiveType)+MoveNext() in /_/Dapper/SqlMapper.cs:line 1183 + at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) + at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) + at Dapper.SqlMapper.Query[T](IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Boolean buffered, Nullable`1 commandTimeout, Nullable`1 commandType) in /_/Dapper/SqlMapper.cs:line 815 + at ProjectLibrary.Repositories.Implementations.LibrarianRepository.ReadLibrarians() in F:\OTP2\ProjectLibrary\ProjectLibrary\Repositories\Implementations\LibrarianRepository.cs:line 101 + Exception data: + Severity: ����� + SqlState: 28P01 + MessageText: ������������ "postgres" �� ������ �������� ����������� (�� ������) + File: auth.c + Line: 324 + Routine: auth_failed -- 2.25.1