Open
Conversation
danlla
requested changes
Mar 12, 2026
danlla
left a comment
There was a problem hiding this comment.
- Нет Readme
- Клиент находится отдельно от остальных проектов, которые лежат в папке
Employee, лучше все проекты оставить в корне - При запуске aspire проекта открывается лишний браузер с клиентом, чтобы этого не происходило нужно задать
"launchBrowser": falseвlaunchsettings.jsonклиента
Comment on lines
+54
to
+57
| private static DateOnly GenerateAdmissionDate(Faker f) | ||
| { | ||
| return DateOnly.FromDateTime(f.Date.Past(10)); | ||
| } |
There was a problem hiding this comment.
Как будто нет смысла выделять это в метод, можно в лямбде RuleFor написать этот код
А еще есть Date.PastDateOnly(10), который сразу вернут только дату
Comment on lines
+43
to
+49
| private static string GeneratePosition(Faker f) | ||
| { | ||
| var level = f.PickRandom(_positionLevels.Keys.ToArray()); | ||
| var profession = f.PickRandom(_professions); | ||
|
|
||
| return $"{level} {profession}"; | ||
| } |
There was a problem hiding this comment.
Этот метод возможно тоже не стоит выделять и написать все в RuleFor
Выделять стоит только большие участки кода
|
|
||
| var start = employee.DateAdmission.ToDateTime(TimeOnly.MinValue); | ||
|
|
||
| var dismissal = f.Date.Between(start, DateTime.Now); |
| /// Преднастроенный генератор | ||
| /// </summary> | ||
| private static readonly Faker<EmployeeModel> _faker = new Faker<EmployeeModel>("ru") | ||
| .RuleFor(e => e.Name, f => GenerateFullName(f)) |
There was a problem hiding this comment.
Тут можно попроще:
.RuleFor(e => e.Name, GenerateFullName)Ниже аналогично
|
|
||
| try | ||
| { | ||
| var expirationMinutes = _configuration.GetValue("CacheSettings:ExpirationMinutes", 5); |
There was a problem hiding this comment.
Лучше один раз считать и сохранить в поле класса
| @@ -0,0 +1,15 @@ | |||
| var builder = DistributedApplication.CreateBuilder(args); | |||
|
|
|||
| var redis = builder.AddRedis("redis"); | |||
There was a problem hiding this comment.
Нужно добавить или .WithRedisInsight(), или .WithRedisCommander()
|
|
||
| var redis = builder.AddRedis("redis"); | ||
|
|
||
| var apiService = builder.AddProject<Projects.Employee_ApiService>("apiservice") |
Comment on lines
+27
to
+31
| if (app.Environment.IsDevelopment()) | ||
| { | ||
| app.UseSwagger(); | ||
| app.UseSwaggerUI(); | ||
| } |
There was a problem hiding this comment.
Если добавлять swagger, то нужно и добавить xml комментарии
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ФИО: Белякова Вероника
Номер группы: 6511
Номер лабораторной: 1
Номер варианта: 2
Краткое описание предметной области: Сотрудник компании
Краткое описание добавленных фич: Создан класс по предметной области, написан генератор и сервис