/// <summary> /// Create a new SeenStatus object. /// </summary> /// <param name="seenAt">Initial value of the SeenAt property.</param> /// <param name="review">Initial value of the Review property.</param> /// <param name="score">Initial value of the Score property.</param> /// <param name="id">Initial value of the Id property.</param> public static SeenStatus CreateSeenStatus(global::System.DateTime seenAt, global::System.String review, global::System.Int32 score, global::System.Int32 id) { SeenStatus seenStatus = new SeenStatus(); seenStatus.SeenAt = seenAt; seenStatus.Review = review; seenStatus.Score = score; seenStatus.Id = id; return seenStatus; }
/// <summary> /// Deprecated Method for adding a new object to the SeenStatuses EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToSeenStatuses(SeenStatus seenStatus) { base.AddObject("SeenStatuses", seenStatus); }
public void SetMySeenStatus(bool seen) { var db = MovieSystemService.DbEntities; var user = MovieSystemService.LoggedInUser; if (seen) { var ss = new SeenStatus() { Movie = this, User = user, SeenAt = DateTime.Now, Review = "", Score = 0 }; } else { var todel = user.SeenStatuses.Where(ss => ss.Movie.Id == this.Id).ToList(); //FIXME: SLOW todel.ForEach(db.DeleteObject); } MovieSystemService.Save(); }