public async Task <ActionResult <TargetResponse> > GetTarget(string id) { Target target = await this.imageRecognition.GetTarget(id); TargetResponse response = this.mapper.Map <TargetResponse>(target); return(Ok(response)); }
public async Task <ActionResult <TargetResponse> > CreateTarget([FromBody] CreateTargetRequest request) { Target target = await this.imageRecognition.CreateTarget( request.DisplayName, request.Description, request.Labels ?? new ReadOnlyDictionary <string, string>(new Dictionary <string, string>()), Convert.FromBase64String(request.ReferenceImage.Base64)); TargetResponse response = this.mapper.Map <TargetResponse>(target); return(Created("GetTarget", response)); }