Implement the function "Add a aircraft"

This commit is contained in:
Sébastien André
2019-12-04 13:51:28 +01:00
parent 6091b2bffa
commit 91b31afd0d
5 changed files with 24 additions and 12 deletions

View File

@@ -32,6 +32,23 @@ namespace skydiveLogs_api.Data
return _col.Update(aircraft);
}
public bool AddAircraft(Aircraft newAircraft)
{
var result = true;
try
{
_col.Insert(newAircraft);
}
catch
{
result = false;
}
return result;
}
private readonly IDataProvider _dataProvider;
private readonly LiteCollection<Aircraft> _col;

View File

@@ -5,5 +5,6 @@ namespace skydiveLogs_api.Data.Interface
{
public interface IAircraftRepository : IRepository<Aircraft>
{
bool AddAircraft(Aircraft newAircraft);
}
}