30 lines
846 B
C#
30 lines
846 B
C#
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.Logging;
|
|
using WinFormDiApp.BL.Models;
|
|
using WinFormDiApp.BLI;
|
|
using WinFormDiApp.DAL;
|
|
|
|
namespace WinFormDiApp.BLR;
|
|
|
|
public class MemberRepository : IMemberRepository
|
|
{
|
|
private readonly ApplicationDbContext _dataContext;
|
|
private readonly IConfiguration _configuration;
|
|
private readonly ILogger<MemberRepository> _logger;
|
|
|
|
public MemberRepository(ApplicationDbContext dataContext, IConfiguration configuration, ILogger<MemberRepository> logger)
|
|
{
|
|
_dataContext = dataContext;
|
|
_configuration = configuration;
|
|
_logger = logger;
|
|
}
|
|
|
|
public IEnumerable<Member> InsertMember(Member member)
|
|
{
|
|
_dataContext.Members.Add(member);
|
|
_dataContext.SaveChanges();
|
|
return _dataContext.Members.ToArray();
|
|
}
|
|
|
|
}
|