public IGameReviewModel FindById(Guid id)
        {
            IGameReview review = m_Query.FindById(id);

            return(review == null
                       ? null
                       : new GameReviewModel(review));
        }
        public void Add(IGameReview instance)
        {
            if (instance.Id == default(Guid))
            {
                instance.Id = Guid.NewGuid();
            }

            m_Dictionary [instance.Id] = instance;
        }
 public GameReviewModel(
     [NotNull] IGameReview review)
 {
     Id            = review.Id;
     Title         = review.Title;
     Description   = review.Description;
     Rating        = review.Rating;
     RatingAsStars = new string('*',
                                review.Rating);
 }
示例#4
0
 public static void AssertEntityAndResponse(
     [NotNull] IGameReview review,
     [NotNull] IGameReviewModel model)
 {
     Assert.AreEqual(review.Id,
                     model.Id,
                     "Id");
     Assert.AreEqual(review.Title,
                     model.Title,
                     "Title");
     Assert.AreEqual(review.Description,
                     model.Description,
                     "Description");
     Assert.AreEqual(review.Rating,
                     model.Rating,
                     "Rating");
     Assert.AreEqual(new string('*',
                                review.Rating),
                     model.RatingAsStars,
                     "RatingAsStars");
 }
        public void Save(IGameReviewModel instance)
        {
            IGameReview toBeUpdated = ToGameReview(instance);

            m_Command.Save(toBeUpdated);
        }
示例#6
0
 public void Remove(IGameReview instance)
 {
     m_Database.Remove(instance);
 }
示例#7
0
 public void Add(IGameReview instance)
 {
     m_Database.Add(instance);
 }
 public void Remove(IGameReview instance)
 {
     Remove(instance.Id);
 }