public async Task <IDomainResult> SetState(string backlogItemId, BacklogItemState newState)
        {
            var fullId = GetFullId(backlogItemId);

            if (!await DbSession.Advanced.ExistsAsync(fullId))
            {
                return(IDomainResult.NotFound());
            }

            DbSession.Advanced.Patch <BacklogItem, BacklogItemState>(fullId, x => x.State, newState);
            await AddHistoryRecordPatch(backlogItemId, $"Changed status to {newState.ToString()}");

            return(IDomainResult.Success());
        }
Beispiel #2
0
 public Task <IActionResult> SetState([FromServices] IBacklogItemCommandService service, [FromRoute] string id, BacklogItemState newState) =>
 service.SetState(id, newState).ToActionResult();