public async Task <IEnumerable <CastResponseModel> > GetCastByMovieId(int id) { var casts = await _castRepository.GetCastsByMovieId(id); var responses = new List <CastResponseModel>(); foreach (var cast in casts) { //response.Add(new CastResponseModel { // CastId=cast.Id, // ProfileUrl=cast.ProfilePath, // CastName=cast.Name, // Character= //}); var response = new CastResponseModel { CastId = cast.Id, ProfileUrl = cast.ProfilePath, CastName = cast.Name, }; responses.Add(response); } return(responses); }