Implement the function "Add a aircraft"
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -5,5 +5,6 @@ namespace skydiveLogs_api.Data.Interface
|
||||
{
|
||||
public interface IAircraftRepository : IRepository<Aircraft>
|
||||
{
|
||||
bool AddAircraft(Aircraft newAircraft);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user