private async Task <ActionResult> GetUser(string id) { if (!await _representationManager.CheckRepresentationExistsAsync(this, string.Format(UsersName, id))) { return(new ContentResult { StatusCode = 412 }); } var result = await _usersAction.GetUser(id, GetLocationPattern()); if (result.IsSucceed()) { await _representationManager.AddOrUpdateRepresentationAsync(this, string.Format(UsersName, result.Id), result.Version, true); } return(this.GetActionResult(result)); }
public async Task <ActionResult> GetUser(string id) { if (string.IsNullOrWhiteSpace(id)) { throw new ArgumentNullException(nameof(id)); } if (!await _representationManager.CheckRepresentationExistsAsync(this, string.Format(UsersName, id))) { return(new ContentResult { StatusCode = 412 }); } var result = await _usersAction.GetUser(id, GetLocationPattern()); if (result.IsSucceed()) { await _representationManager.AddOrUpdateRepresentationAsync(this, string.Format(UsersName, result.Id), result.Version, true); } return(this.GetActionResult(result)); }