forked from slavaxom9k/PIBD-23_Fomichev_V.S._MagicCarpet
праавки
This commit is contained in:
@@ -26,9 +26,7 @@ internal class EmployeeStorageContract : IEmployeeStorageContract
|
|||||||
});
|
});
|
||||||
_mapper = new Mapper(config);
|
_mapper = new Mapper(config);
|
||||||
}
|
}
|
||||||
|
public List<EmployeeDataModel> GetList(bool onlyActive = true, string? postId = null, DateTime? fromBirthDate = null, DateTime? toBirthDate = null, DateTime? fromEmploymentDate = null, DateTime? toEmploymentDate = null)
|
||||||
public List<EmployeeDataModel> GetList(bool onlyActive = true, string? email = null, DateTime? fromBirthDate = null, DateTime? toBirthDate = null,
|
|
||||||
DateTime? fromEmploymentDate = null, DateTime? toEmploymentDate = null, string postId = null)
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -37,9 +35,9 @@ internal class EmployeeStorageContract : IEmployeeStorageContract
|
|||||||
{
|
{
|
||||||
query = query.Where(x => !x.IsDeleted);
|
query = query.Where(x => !x.IsDeleted);
|
||||||
}
|
}
|
||||||
if (email is not null)
|
if (postId is not null)
|
||||||
{
|
{
|
||||||
query = query.Where(x => x.PostId == email);
|
query = query.Where(x => x.PostId == postId);
|
||||||
}
|
}
|
||||||
if (fromBirthDate is not null && toBirthDate is not null)
|
if (fromBirthDate is not null && toBirthDate is not null)
|
||||||
{
|
{
|
||||||
@@ -156,6 +154,4 @@ internal class EmployeeStorageContract : IEmployeeStorageContract
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Employee? GetEmployeeById(string id) => _dbContext.Employees.FirstOrDefault(x => x.Id == id && !x.IsDeleted);
|
private Employee? GetEmployeeById(string id) => _dbContext.Employees.FirstOrDefault(x => x.Id == id && !x.IsDeleted);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,5 +9,5 @@ namespace MagicCarpetTests.Infrastructure;
|
|||||||
|
|
||||||
internal class ConfigurationDatabaseTest : IConfigurationDatabase
|
internal class ConfigurationDatabaseTest : IConfigurationDatabase
|
||||||
{
|
{
|
||||||
public string ConnectionString => "Host=local;Port=5432;Database=MagicCarpetTest;Username=postgres;Password=postgres;";
|
public string ConnectionString => "Host=127.0.0.1;Port=5432;Database=MagicCarpetTest;Username=postgres;Password=postgres;";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user