Looks like we finally have a solution.
Change logging to just log a message, instead of the exception. Moved logic to Syncer involvement. When posting the data, if a 500 is returned, then it is up to the Syncer to re-submit it.
This commit is contained in:
parent
73955353cb
commit
004c490dd8
23 changed files with 529 additions and 177 deletions
|
|
@ -23,8 +23,11 @@ public class Repository<TEntity> : IRepository<TEntity> where TEntity : class
|
|||
|
||||
public async Task UpdateAsync(TEntity entity, CancellationToken ct, bool sync = true)
|
||||
{
|
||||
_dbSet.Attach(entity);
|
||||
_context.Entry(entity).State = EntityState.Modified;
|
||||
if (!_dbSet.Local.Contains(entity))
|
||||
{
|
||||
_dbSet.Attach(entity);
|
||||
_context.Entry(entity).State = EntityState.Modified;
|
||||
}
|
||||
if (sync)
|
||||
await _context.SaveChangesAsync(ct);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue