Пример #1
0
 public void AddFriendToCharacter(Character character, Character friend)
 {
     _context.Add(new CharacterFriend()
     {
         CharacterId = character.Id, CharacterFriendId = friend.Id
     });
 }
Пример #2
0
 public override IGraphQlObjectResult <Interfaces.Review?> CreateReview(Interfaces.Episode?episode, Interfaces.ReviewInput review)
 {
     return(this.ResolveTask(async _ =>
     {
         var newReview = new Domain.Review {
             Stars = review.Stars, Episode = InterfaceToDomain.ConvertEpisode(episode !.Value), Commentary = review.Commentary
         };
         dbContext.Add(newReview);
         await dbContext.SaveChangesAsync().ConfigureAwait(false);
         return newReview;
     }).AsContract <Review>());
 }