chatbot/Chatbot.Domain.Data/Repositories/BotRepository.cs

24 lines
572 B
C#
Raw Normal View History

2020-06-06 18:29:20 +03:00
using Chatbot.Api.Domain.Data.DbContexts;
using Chatbot.Api.Domain.Entities;
using Chatbot.Api.Domain.Repositories;
using Microsoft.EntityFrameworkCore;
using System.Threading.Tasks;
namespace Chatbot.Api.Domain.Data.Repositories
{
class BotRepository : IBotRepository
{
private readonly BotDbContext _dbContext;
public BotRepository(BotDbContext dbContext)
{
_dbContext = dbContext;
}
public async Task<Bot[]> GetBots()
{
return await _dbContext.Bots.ToArrayAsync();
}
}
}