public async Task SetPropertyForAsset(SetPropertyForAssetRequestModel model) { var currentAsset = imDbContext.Assets.SingleOrDefault(a => a.AssetId == model.AssetId); if (currentAsset == null) { logger.LogError($"AssetId can not be found {model.AssetId}"); } else if (currentAsset.TimeStamp > model.TimeStamp) { logger.LogWarning($"Asset has smaller timestamp so skipping. AssetID : {model.AssetId}"); } else { assetPropertySetter.SetPropertyOfAssetEntity(model, currentAsset); } imDbContext.Update(currentAsset); await imDbContext.SaveChangesAsync(); }
public void Update(TEntity entity) { _context.Update(entity); }