public void AddFriendToCharacter(Character character, Character friend) { _context.Add(new CharacterFriend() { CharacterId = character.Id, CharacterFriendId = friend.Id }); }
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>()); }