Refactoring
This commit is contained in:
@@ -48,13 +48,13 @@ namespace FoodsharingSiegen.Server.Data.Service
|
||||
var saveR = await Context.SaveChangesAsync();
|
||||
|
||||
if (saveR > 0)
|
||||
return new OperationResult<Audit>(audit);
|
||||
return new(audit);
|
||||
|
||||
return new OperationResult<Audit>(new Exception("Couldn't add audit"));
|
||||
return new(new Exception("Couldn't add audit"));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return new OperationResult<Audit>(e);
|
||||
return new(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,13 +84,13 @@ namespace FoodsharingSiegen.Server.Data.Service
|
||||
|
||||
var mat = query?.ToList();
|
||||
|
||||
if (mat != null) return new OperationResult<List<Audit>>(mat);
|
||||
if (mat != null) return new(mat);
|
||||
|
||||
return new OperationResult<List<Audit>>(new Exception("Couldn't load audits"));
|
||||
return new(new Exception("Couldn't load audits"));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return new OperationResult<List<Audit>>(e);
|
||||
return new(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user