/// <inheritdoc /> public Placeholder Find(string id) { this.logger.LogInformation($"Выполняется поиск Placeholder с идентификатором '{id}' в хранилище Placeholder."); using (PlaceholderContext context = new PlaceholderContext(this.connectionString)) { PlaceholderDto dto = context.Placeholders.FirstOrDefault(o => o.Id == id); return(dto != null ? new Placeholder(dto.Id) : null); } }
/// <inheritdoc /> public List <Placeholder> Find() { this.logger.LogInformation("Выполняется поиск всех Placeholder в хранилище Placeholder."); using (PlaceholderContext context = new PlaceholderContext(this.connectionString)) { DbSet <PlaceholderDto> dtos = context.Placeholders; return(dtos.Select(o => new Placeholder(o.Id)).ToList()); } }