Auto clean code

This commit is contained in:
Sébastien André
2021-04-22 23:31:08 +02:00
parent 1c66efa4e8
commit 0d136a938a
29 changed files with 325 additions and 227 deletions

View File

@@ -1,37 +1,25 @@
using System.Collections.Generic;
using System.Linq;
using LiteDB;
using LiteDB;
using skydiveLogs_api.Domain;
using skydiveLogs_api.DomainService.Repositories;
using skydiveLogs_api.Infrastructure.Interfaces;
using System.Collections.Generic;
using System.Linq;
namespace skydiveLogs_api.Infrastructure
{
public class DropZoneRepository : IDropZoneRepository
{
#region Public Constructors
public DropZoneRepository(IDataProvider dataProvider)
{
_dataProvider = dataProvider;
_col = _dataProvider.CollOfDropZone;
}
public IEnumerable<DropZone> GetAll()
{
return _col.FindAll().ToList();
}
#endregion Public Constructors
public DropZone GetById(int id)
{
return _col.FindById(new BsonValue(id));
}
public bool Update(DropZone updatedDz)
{
return _col.Update(updatedDz);
}
#region Public Methods
public int Add(DropZone newDz)
{
@@ -50,8 +38,28 @@ namespace skydiveLogs_api.Infrastructure
return result;
}
private readonly IDataProvider _dataProvider;
public IEnumerable<DropZone> GetAll()
{
return _col.FindAll().ToList();
}
public DropZone GetById(int id)
{
return _col.FindById(new BsonValue(id));
}
public bool Update(DropZone updatedDz)
{
return _col.Update(updatedDz);
}
#endregion Public Methods
#region Private Fields
private readonly ILiteCollection<DropZone> _col;
private readonly IDataProvider _dataProvider;
#endregion Private Fields
}
}
}