public MovieDataSourcePersonData(string name, string imdbId, int tmdbId, int sortOrder, Cast.Jobs job, string roleName)
 {
     _name = name;
     _imdbId = imdbId;
     _tmdbId = tmdbId;
     _sortOrder = sortOrder;
     _job = job;
     _roleName = roleName;
 }
예제 #2
0
파일: Movie.cs 프로젝트: cocytus/epidaurus
 public void AddCastMember(Cast.Jobs job, string name, string imdbId, int tmdbId, int sortOrder, string roleName)
 {
     if (this.EntityState == System.Data.EntityState.Added)
         throw new InvalidOperationException("Can not add cast to new movie");
     var person = MovieSystemService.GetOrCreatePerson(name, imdbId, tmdbId);
     var cast = Cast.CreateCast(0, job.ToString(), person.Id, Id);
     cast.SortOrder = sortOrder;
     cast.RoleName = !string.IsNullOrWhiteSpace(roleName) ? roleName : null;
     MovieSystemService.DbEntities.AddToCasts(cast);
 }
예제 #3
0
 /// <summary>
 /// Create a new Cast object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="job">Initial value of the Job property.</param>
 /// <param name="personId">Initial value of the PersonId property.</param>
 /// <param name="movieId">Initial value of the MovieId property.</param>
 public static Cast CreateCast(global::System.Int32 id, global::System.String job, global::System.Int32 personId, global::System.Int32 movieId)
 {
     Cast cast = new Cast();
     cast.Id = id;
     cast.Job = job;
     cast.PersonId = personId;
     cast.MovieId = movieId;
     return cast;
 }
예제 #4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Casts EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCasts(Cast cast)
 {
     base.AddObject("Casts", cast);
 }
예제 #5
0
 private IList<Cast> GetSortedJob(Cast.Jobs job)
 {
     if (!_movie.Casts.IsLoaded)
         _movie.Casts.Load();
     var jobStr = job.ToString();
     return (from c in _movie.Casts where c.Job == jobStr orderby c.SortOrder select c).ToList();
 }
예제 #6
0
파일: Movie.cs 프로젝트: cocytus/epidaurus
 public void ClearType(Cast.Jobs type)
 {
     var toDel = Casts.Where(el => el.Job == type.ToString()).ToList();
     foreach (var del in toDel)
         Casts.Remove(del);
 }