public async Task <TeamCloudInstanceDocument> RunActivity( [ActivityTrigger] TeamCloudInstanceDocument teamCloudInstance) { if (teamCloudInstance is null) { throw new ArgumentNullException(nameof(teamCloudInstance)); } teamCloudInstance = await teamCloudRepository .SetAsync(teamCloudInstance) .ConfigureAwait(false); return(teamCloudInstance); }
public async Task <IActionResult> Post( [HttpTrigger(AuthorizationLevel.Function, "post", Route = "data/teamCloudInstance")] TeamCloudInstanceDocument teamCloudInstance) { if (teamCloudInstance is null) { throw new ArgumentNullException(nameof(teamCloudInstance)); } var newTeamCloudInstance = await teamCloudRepository .SetAsync(teamCloudInstance) .ConfigureAwait(false); return(new OkObjectResult(newTeamCloudInstance)); }
public static Task <TeamCloudInstanceDocument> SetTeamCloudAsync(this IDurableOrchestrationContext functionContext, TeamCloudInstanceDocument teamCloud) { if (teamCloud is null) { throw new ArgumentNullException(nameof(teamCloud)); } if (functionContext.IsLockedByContainerDocument(teamCloud)) { return(functionContext .CallActivityWithRetryAsync <TeamCloudInstanceDocument>(nameof(TeamCloudSetActivity), teamCloud)); } throw new NotSupportedException($"Unable to set '{typeof(TeamCloudInstanceDocument)}' without acquired lock"); }