public static Actores CargarActorDTOAActor(ActorDTO actorDTO) { Actores actor = new Actores(); actor.actorname = actorDTO.actorname; actor.birthdate = actorDTO.birthdate; actor.country = actorDTO.country; actor.idactor = actorDTO.idactor; actor.photo = actorDTO.photo; actor.score = actorDTO.score; actor.idactor = actorDTO.idactor; return(actor); }
//---------------------------------- //----- Actores //---------------------------------- public bool AsignarActor(int idserie, int idactor) { SeriesDBEntities se = new SeriesDBEntities(); #if DEBUG se.Database.Log = s => Console.WriteLine(s); #endif Series serie = se.Series.SingleOrDefault(c => c.idserie == idserie); Actores actor = se.Actores.SingleOrDefault(c => c.idactor == idactor); serie.Actores.Add(actor); se.SaveChanges(); return(true); }