コード例 #1
0
 /// <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;
 }
コード例 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the SeenStatuses EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSeenStatuses(SeenStatus seenStatus)
 {
     base.AddObject("SeenStatuses", seenStatus);
 }
コード例 #3
0
ファイル: Movie.cs プロジェクト: cocytus/epidaurus
        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();
        }