private async Task <ActionResult <EntitiesResponse <Account> > > Activate([FromBody] List <int> ids, bool returnEntities, string expand, bool isDeprecated) { // Parse parameters var expandExp = ExpandExpression.Parse(expand); var idsArray = ids.ToArray(); // Check user permissions await CheckActionPermissions("IsDeprecated", idsArray); // Execute and return using var trx = ControllerUtilities.CreateTransaction(); await _repo.Accounts__Deprecate(ids, isDeprecated); if (returnEntities) { var response = await GetByIdListAsync(idsArray, expandExp); trx.Complete(); return(Ok(response)); } else { trx.Complete(); return(Ok()); } }