Feature/tech debt (#199)

* Added an icon for building the exe

* Technical debt
This commit is contained in:
Joseph Milazzo 2021-05-05 21:00:50 -05:00 committed by GitHub
parent d92e9e7602
commit f694145cd9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 76 additions and 112 deletions

View file

@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using API.DTOs;
@ -10,7 +9,6 @@ using API.Interfaces;
using AutoMapper;
using AutoMapper.QueryableExtensions;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
namespace API.Data
{
@ -18,13 +16,11 @@ namespace API.Data
{
private readonly DataContext _context;
private readonly IMapper _mapper;
private readonly ILogger _logger;
public SeriesRepository(DataContext context, IMapper mapper, ILogger logger)
public SeriesRepository(DataContext context, IMapper mapper)
{
_context = context;
_mapper = mapper;
_logger = logger;
}
public void Add(Series series)
@ -289,6 +285,7 @@ namespace API.Data
/// <summary>
/// Returns a list of Series that were added, ordered by Created desc
/// </summary>
/// <param name="userId"></param>
/// <param name="libraryId">Library to restrict to, if 0, will apply to all libraries</param>
/// <param name="limit">How many series to pick.</param>
/// <returns></returns>

View file

@ -3,7 +3,6 @@ using API.Entities;
using API.Interfaces;
using AutoMapper;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Logging;
namespace API.Data
{
@ -12,17 +11,15 @@ namespace API.Data
private readonly DataContext _context;
private readonly IMapper _mapper;
private readonly UserManager<AppUser> _userManager;
private readonly ILogger<UnitOfWork> _logger;
public UnitOfWork(DataContext context, IMapper mapper, UserManager<AppUser> userManager, ILogger<UnitOfWork> logger)
public UnitOfWork(DataContext context, IMapper mapper, UserManager<AppUser> userManager)
{
_context = context;
_mapper = mapper;
_userManager = userManager;
_logger = logger;
}
public ISeriesRepository SeriesRepository => new SeriesRepository(_context, _mapper, _logger);
public ISeriesRepository SeriesRepository => new SeriesRepository(_context, _mapper);
public IUserRepository UserRepository => new UserRepository(_context, _userManager);
public ILibraryRepository LibraryRepository => new LibraryRepository(_context, _mapper);