Auto clean code
This commit is contained in:
@@ -1,22 +1,42 @@
|
||||
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 GearRepository : IGearRepository
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public GearRepository(IDataProvider dataProvider)
|
||||
{
|
||||
_dataProvider = dataProvider;
|
||||
_col = _dataProvider.CollOfGear;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public int Add(Gear newGear)
|
||||
{
|
||||
int result;
|
||||
|
||||
try
|
||||
{
|
||||
var tmp = _col.Insert(newGear);
|
||||
result = tmp.AsInt32;
|
||||
}
|
||||
catch
|
||||
{
|
||||
result = 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public IEnumerable<Gear> GetAll()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
@@ -40,25 +60,13 @@ namespace skydiveLogs_api.Infrastructure
|
||||
return _col.Update(updatedGear);
|
||||
}
|
||||
|
||||
public int Add(Gear newGear)
|
||||
{
|
||||
int result;
|
||||
#endregion Public Methods
|
||||
|
||||
try
|
||||
{
|
||||
var tmp = _col.Insert(newGear);
|
||||
result = tmp.AsInt32;
|
||||
}
|
||||
catch
|
||||
{
|
||||
result = 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private readonly IDataProvider _dataProvider;
|
||||
#region Private Fields
|
||||
|
||||
private readonly ILiteCollection<Gear> _col;
|
||||
private readonly IDataProvider _dataProvider;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user