public async Task ProcessEventAsync(SfEvent sfEvent) { try { var sfClient = await _sfClientFactory.GetClientAsync(); var fileUrl = sfClient.Items.GetEntityUriFromId(sfEvent.Event.Resource.Id); var file = await sfClient.Items.Get(fileUrl).ExecuteAsync(); var share = await GetShareAsync(sfClient, file); await Enqueue(file, share); _logger.LogInformation("File processed successfully"); } catch (Exception ex) { _logger.LogError(ex, "Exception processing upload event"); } }
public IActionResult Post([FromBody] SfEvent sfEvent) { _service.ProcessEventAsync(sfEvent); return(StatusCode(200)); }