Merge branch 'feature/well-contacts' of http://test.digitaldrilling.ru:8080/DDrilling/AsbCloudServer into feature/well-contacts

This commit is contained in:
Olga Nemt 2023-06-23 12:13:26 +05:00
commit 464dd57eef

View File

@ -22,7 +22,6 @@ namespace AsbCloudInfrastructure.Services
public async Task<IEnumerable<CompanyWithUsersDto>> GetAsync(int wellId, int contactTypeId, CancellationToken token)
{
var query = db.Companies
.Where(c => c.IdCompanyType == contactTypeId)
.Where(c => c.RelationCompaniesWells.Any(rc => rc.IdWell == wellId))
@ -81,21 +80,5 @@ namespace AsbCloudInfrastructure.Services
return await db.SaveChangesAsync(token)
.ConfigureAwait(false);
}
private static UserContactDto Convert(User u, int wellId)
{
return new UserContactDto()
{
Id = u.Id,
Name = u.Name,
Patronymic = u.Patronymic,
Surname = u.Surname,
Company = u.Company.Adapt<CompanyDto>(),
Email = u.Email,
Phone = u.Phone,
Position = u.Position,
IsContact = u.RelationContactsWells.Any(rel => rel.IdWell == wellId)
};
}
}
}