Untitled
unknown
csharp
2 years ago
537 B
7
Indexable
var repository = _context
.Set<TEntity>();
var entity = await repository
.FirstOrDefaultAsync(x => x.Id == request.Id, cancellationToken: cancellationToken);
if (entity == null)
{
var notFound = new AppNotFoundException(typeof(TEntity).Name, $"no dataset with id '{request.Id}' found");
return new Result<TEntity>(notFound);
}
_mapper.Map(request, entity);
await _context.SaveChangesAsync(cancellationToken);
return entityEditor is loading...
Leave a Comment