public void CreateActors(List <ActorModel> actors, int movieId) { foreach (var actor in actors) { int actorId; CreateIfNotExists(actor.Name, out actorId); var actorMovieParams = new ActorMovieParams(); actorMovieParams.ActorId = actorId; actorMovieParams.MovieId = movieId; actorMovieParams.CharacterName = actor.CharacterName; actorMovieParams.IsStar = actor.IsStar; actorMovieParams.Status = Status.Active; actorMovieParams.UserType = UserTypes.Dashboard; _actorMovieService.CreateOrUpdate(actorMovieParams); } }
public void CreateActorsById(IEnumerable <int> actorIds, int movieId) { _actorMovieService.DeleteActorMovies(movieId); foreach (var actorId in actorIds) { var actor = Get(actorId); int actorCreatedId; CreateIfNotExists(actor.Name, out actorCreatedId); var actorMovieParams = new ActorMovieParams(); actorMovieParams.ActorId = actorId; actorMovieParams.MovieId = movieId; //actorMovieParams.CharacterName = actor.CharacterName; //actorMovieParams.IsStar = actor.IsStar; actorMovieParams.Status = Status.Active; actorMovieParams.UserType = UserTypes.Dashboard; _actorMovieService.CreateOrUpdate(actorMovieParams); } }