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,26 +1,24 @@
using System.Collections.Generic;
using LiteDB;
using LiteDB;
using skydiveLogs_api.Domain;
using skydiveLogs_api.DomainService.Repositories;
using skydiveLogs_api.Infrastructure.Interfaces;
using System.Collections.Generic;
namespace skydiveLogs_api.Infrastructure
{
public class FavoriteDropZoneRepository : IFavoriteDropZoneRepository
{
#region Public Constructors
public FavoriteDropZoneRepository(IDataProvider dataProvider)
{
_dataProvider = dataProvider;
_col = _dataProvider.CollOfFavoriteDropZone;
}
public int Delete(int dropZoneId, int userId)
{
return _col.DeleteMany(d => d.DropZone.Id == dropZoneId && d.User.Id == userId);
}
#endregion Public Constructors
#region Public Methods
public int Add(FavoriteDropZone favoriteToAdd)
{
@@ -39,6 +37,11 @@ namespace skydiveLogs_api.Infrastructure
return result;
}
public int Delete(int dropZoneId, int userId)
{
return _col.DeleteMany(d => d.DropZone.Id == dropZoneId && d.User.Id == userId);
}
public IEnumerable<FavoriteDropZone> GetAll(User user)
{
return _col.Query()
@@ -46,6 +49,11 @@ namespace skydiveLogs_api.Infrastructure
.ToList();
}
public IEnumerable<FavoriteDropZone> GetAll()
{
throw new System.NotImplementedException();
}
public FavoriteDropZone GetById(int id)
{
throw new System.NotImplementedException();
@@ -56,13 +64,13 @@ namespace skydiveLogs_api.Infrastructure
throw new System.NotImplementedException();
}
public IEnumerable<FavoriteDropZone> GetAll()
{
throw new System.NotImplementedException();
}
#endregion Public Methods
private readonly IDataProvider _dataProvider;
#region Private Fields
private readonly ILiteCollection<FavoriteDropZone> _col;
private readonly IDataProvider _dataProvider;
#endregion Private Fields
}
}
}