mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
remove member prefixes per "Clean Code"
This commit is contained in:
parent
f43a80a92f
commit
ac26c41033
5 changed files with 17 additions and 17 deletions
|
|
@ -8,17 +8,17 @@ namespace FilterLists.Api.Controllers
|
|||
[Route("v1/[controller]")]
|
||||
public class ListsController : Controller
|
||||
{
|
||||
private readonly IListService _listService;
|
||||
private readonly IListService listService;
|
||||
|
||||
public ListsController(IListService listService)
|
||||
{
|
||||
_listService = listService;
|
||||
this.listService = listService;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult Get()
|
||||
{
|
||||
return Json(_listService.GetAll());
|
||||
return Json(listService.GetAll());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,21 +8,21 @@ namespace FilterLists.Data.Repositories.Implementations
|
|||
{
|
||||
public class ListRepository : IListRepository
|
||||
{
|
||||
private readonly IFilterListsDbContext _filterListsDbContext;
|
||||
private readonly IFilterListsDbContext filterListsDbContext;
|
||||
|
||||
public ListRepository(FilterListsDbContext filterListsDbContext)
|
||||
{
|
||||
_filterListsDbContext = filterListsDbContext;
|
||||
this.filterListsDbContext = filterListsDbContext;
|
||||
}
|
||||
|
||||
public IEnumerable<IList> GetAll()
|
||||
{
|
||||
return _filterListsDbContext.List.AsEnumerable();
|
||||
return filterListsDbContext.List.AsEnumerable();
|
||||
}
|
||||
|
||||
public IList GetByName(string listName)
|
||||
{
|
||||
return _filterListsDbContext.List.First(x => x.Name == listName);
|
||||
return filterListsDbContext.List.First(x => x.Name == listName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,21 +8,21 @@ namespace FilterLists.Data.Repositories.Implementations
|
|||
{
|
||||
public class TableCsvRepository : ITableCsvRepository
|
||||
{
|
||||
private readonly IFilterListsDbContext _filterListsDbContext;
|
||||
private readonly IFilterListsDbContext filterListsDbContext;
|
||||
|
||||
public TableCsvRepository(FilterListsDbContext filterListsDbContext)
|
||||
{
|
||||
_filterListsDbContext = filterListsDbContext;
|
||||
this.filterListsDbContext = filterListsDbContext;
|
||||
}
|
||||
|
||||
public IEnumerable<ITableCsv> GetAll()
|
||||
{
|
||||
return _filterListsDbContext.TableCsv.AsEnumerable();
|
||||
return filterListsDbContext.TableCsv.AsEnumerable();
|
||||
}
|
||||
|
||||
public string GetUrlByName(string name)
|
||||
{
|
||||
return _filterListsDbContext.TableCsv.FirstOrDefault(x => x.Name == name).Url;
|
||||
return filterListsDbContext.TableCsv.FirstOrDefault(x => x.Name == name).Url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -7,16 +7,16 @@ namespace FilterLists.Services.Implementations
|
|||
{
|
||||
public class ListService : IListService
|
||||
{
|
||||
private readonly IListRepository _listRepository;
|
||||
private readonly IListRepository listRepository;
|
||||
|
||||
public ListService(IListRepository listRepository)
|
||||
{
|
||||
_listRepository = listRepository;
|
||||
this.listRepository = listRepository;
|
||||
}
|
||||
|
||||
public IEnumerable<IList> GetAll()
|
||||
{
|
||||
return _listRepository.GetAll();
|
||||
return listRepository.GetAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -10,11 +10,11 @@ namespace FilterLists.Services.Implementations
|
|||
{
|
||||
public class TableService : ITableService
|
||||
{
|
||||
private readonly ITableCsvRepository _tableCsvRepository;
|
||||
private readonly ITableCsvRepository tableCsvRepository;
|
||||
|
||||
public TableService(ITableCsvRepository tableCsvRepository)
|
||||
{
|
||||
_tableCsvRepository = tableCsvRepository;
|
||||
this.tableCsvRepository = tableCsvRepository;
|
||||
}
|
||||
|
||||
public void UpdateTables()
|
||||
|
|
@ -24,7 +24,7 @@ public void UpdateTables()
|
|||
|
||||
public void UpdateListTable()
|
||||
{
|
||||
var localCsvFilePath = FetchFile(_tableCsvRepository.GetUrlByName("List"), "List").Result;
|
||||
var localCsvFilePath = FetchFile(tableCsvRepository.GetUrlByName("List"), "List").Result;
|
||||
TextReader textReader = File.OpenText(localCsvFilePath);
|
||||
var csv = new CsvReader(textReader);
|
||||
csv.Configuration.MissingFieldFound = null;
|
||||
|
|
|
|||
Loading…
Reference in a new issue