Adding MaidBotApi
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using LCU.Api.Internal.MaidBotLib.Models;
|
||||
using LCU.Api.Internal.MaidBotLib.Persistence;
|
||||
|
||||
namespace LCU.Api.Internal.MaidBotLib.Repositories
|
||||
{
|
||||
public class EventLogRepository : BaseRepository, IEventLogRepository
|
||||
{
|
||||
public EventLogRepository(AppDbContext context) : base(context) { }
|
||||
|
||||
public async Task<IEnumerable<EventLog>> ListAsync()
|
||||
{
|
||||
return await _context.EventLogs.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<EventLog> AddAsync(EventLog eventLog)
|
||||
{
|
||||
var result = await _context.EventLogs.AddAsync(eventLog);
|
||||
return result.Entity;
|
||||
}
|
||||
|
||||
public void RemoveRange(List<EventLog> eventLog)
|
||||
{
|
||||
_context.EventLogs.RemoveRange(eventLog);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user