Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Load Movie.Categories.

  • Loading branch information...
commit 5723a106cd9636be06894bca0a222f58f54041b2 1 parent fa03f3d
@mwisnicki authored
Showing with 12 additions and 2 deletions.
  1. +12 −2 PWr.DW2012.Movies.ETL/Model/Main.cs
View
14 PWr.DW2012.Movies.ETL/Model/Main.cs
@@ -68,8 +68,8 @@ public class Movie {
/// </remarks>
/// </summary>
public ProcessCode Process { get; set; }
- public ISet<MovieCategory> Categories { get; set; }
#endif
+ public ISet<MovieCategory> Categories { get; set; }
public ISet<Award> Awards { get; set; }
public ISet<Cast> Cast { get; set; }
#if false
@@ -106,6 +106,10 @@ public class Movie {
public string Notes { get; set; } // Nt()
// ignore: Seen, VT
#endregion
+
+ public Movie() {
+ Categories = new HashSet<MovieCategory>();
+ }
}
@@ -142,7 +146,13 @@ class MoviesLoader : PWr.DW2012.Movies.Program.TableLoader<Movie, string> {
//movie.Producers.Add(r[4]); !
//movie.Studios.Add(r[5]);
//movie.Process = r[6];
- //movie.Categories.Add(r[7]);
+ var cats = row.XPathSelectElements("cats/cat");
+ if (cats != null) {
+ foreach (var cat in cats) {
+ var oCat = db.MovieCategories.Find(cat.Value);
+ movie.Categories.Add(oCat);
+ }
+ }
//movie.Awards.Add(r[8]);
//movie.Locations.Add(r[9]);
xe = row.XPathSelectElement("notes");
Please sign in to comment.
Something went wrong with that request. Please try again.