public async Task <IActionResult> GetActorByIdAsync([FromRoute] ActorIdParameter actorIdParameter) { _ = actorIdParameter ?? throw new ArgumentNullException(nameof(actorIdParameter)); string method = nameof(GetActorByIdAsync) + actorIdParameter.ActorId; // return result return(await ResultHandler.Handle( dal.GetActorAsync(actorIdParameter.ActorId), method, "Actor Not Found", logger) .ConfigureAwait(false)); }
public void ActorId_ValidateRegularExpression_ReturnsExpectedResult(string input, bool expectedResult) { // Arrange var actorIdParameter = new ActorIdParameter(); // Act var isValid = IsValidProperty(actorIdParameter, input, "ActorId"); // Assert Assert.Equal(expectedResult, isValid); }
public async Task <IActionResult> GetActorByIdAsync([FromRoute] ActorIdParameter actorIdParameter) { if (actorIdParameter == null) { throw new ArgumentNullException(nameof(actorIdParameter)); } string method = nameof(GetActorByIdAsync) + actorIdParameter.ActorId; // return result return(await DataService.Read <Actor>(Request).ConfigureAwait(false)); }