Beispiel #1
0
		async public void SaveToParse ()
		{
			ParseObject catalog;
			if (this.ParseId == null || this.ParseId == "") {
				catalog = new ParseObject ("Catalogo");
			} else {
				ParseQuery<ParseObject> query = ParseObject.GetQuery ("Catalogo");
				catalog = await query.GetAsync (this.ParseId);
			}

			IList<string> movies = new List<string> ();
			MoviexCatalogDB moviexCatalogDB = new MoviexCatalogDB ();
			foreach (MoviexCatalog moviexCatalog in moviexCatalogDB.All ().Where (mxc => mxc.IdCatalog.Equals (this.Id))) {
				moviexCatalog.SaveToParse ();
				movies.Add (moviexCatalog.ParseId);
			}

			if (this.User != null) {
				catalog ["Usuario"] = this.User.ParseId;
			}
			catalog ["Peliculas"] = movies;

			await catalog.SaveAsync ().ContinueWith (t => {
				this.ParseId = catalog.ObjectId;
				Console.WriteLine("Saved Catalog in Parse: " + this.ParseId);
				CatalogDB catalogDB = new CatalogDB ();
				catalogDB.Update (this);
			});
		}
Beispiel #2
0
		async public void SaveToParse ()
		{
			ParseObject moviexCatalog;
			if (this.ParseId == null || this.ParseId == "") {
				moviexCatalog = new ParseObject ("Catalogo_detalle");
			} else {
				ParseQuery<ParseObject> query = ParseObject.GetQuery ("Catalogo_detalle");
				moviexCatalog = await query.GetAsync (this.ParseId);
			}

			moviexCatalog ["Pelicula"] = this.Movie.ParseId;

			await moviexCatalog.SaveAsync ().ContinueWith (t => {
				this.ParseId = moviexCatalog.ObjectId;
				Console.WriteLine("Saved MoviexCatalog in Parse: " + this.ParseId);
				MoviexCatalogDB moviexCatalogDB = new MoviexCatalogDB ();
				moviexCatalogDB.Update (this);
			});
		}