Todo : Fix format
RestService : Fix connection if first connection fail BL : Fix Update/Delete return value
This commit is contained in:
@@ -16,10 +16,23 @@ namespace LaDOSE.Business.Service
|
||||
|
||||
public override bool Delete(int id)
|
||||
{
|
||||
var find = _context.Find<Todo>(id);
|
||||
find.Deleted = DateTime.Now;
|
||||
this._context.SaveChanges();
|
||||
return _context.Entry(find).State == EntityState.Modified;
|
||||
try
|
||||
{
|
||||
var find = _context.Find<Todo>(id);
|
||||
if (find != null)
|
||||
{
|
||||
if (find.Deleted.HasValue)
|
||||
return false;
|
||||
find.Deleted = DateTime.Now;
|
||||
}
|
||||
|
||||
this._context.SaveChanges();
|
||||
return true;
|
||||
}
|
||||
catch (DbUpdateException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override IEnumerable<Todo> GetAll()
|
||||
|
||||
Reference in New Issue
Block a user