public async Task <AddChoicePayload> AddChoiceAsync(AddChoiceInput input, [ScopedService] SocialAppGraphQLContext context) { var choice = new Choice { ChoiceType = input.choiceType, QuestionId = input.questionId, }; context.Choices.Add(choice); await context.SaveChangesAsync(); return(new AddChoicePayload(choice)); }
public async Task <AddQuestionPayload> AddQuestionAsync(AddQuestionInput input, [ScopedService] SocialAppGraphQLContext context, [Service] ITopicEventSender eventSender, CancellationToken cancellationToken ) { var question = new Question { QuestionType = input.question, }; context.Questions.Add(question); await context.SaveChangesAsync(cancellationToken); await eventSender.SendAsync(nameof(Subscription.OnQuestionAdded), question, cancellationToken); return(new AddQuestionPayload(question)); }
public IQueryable <ChatLevel> GetChatLevel([ScopedService] SocialAppGraphQLContext context) { return(context.ChatLevels); }
public IQueryable <Bank> GetBank([ScopedService] SocialAppGraphQLContext context) { return(context.Banks); }
public IQueryable <Choice> GetChoice([ScopedService] SocialAppGraphQLContext context) { return(context.Choices); }
public IQueryable <Question> GetQuestion([ScopedService] SocialAppGraphQLContext context) { return(context.Questions); }
public IQueryable <Notification> GetNotification([ScopedService] SocialAppGraphQLContext context) { return(context.Notifications); }
public IQueryable <Like> GetLikes([ScopedService] SocialAppGraphQLContext context) { return(context.Likes); }
public IQueryable <Photo> GetPhoto([ScopedService] SocialAppGraphQLContext context) { return(context.Photos); }
public Profile GetProfile(Prefer prefer, [ScopedService] SocialAppGraphQLContext context) { return(context.Profiles.FirstOrDefault(p => p.PreferId == p.PreferId)); }
public IQueryable <Choice> GetChoices(Question question, [ScopedService] SocialAppGraphQLContext context) { return(context.Choices.Where(c => c.QuestionId == question.QuestionId)); }
public Question GetQuestion(Choice choice, [ScopedService] SocialAppGraphQLContext context) { return(context.Questions.FirstOrDefault(q => q.QuestionId == choice.QuestionId)); }
public Profile GetProfile(Notification notification, [ScopedService] SocialAppGraphQLContext context) { return(context.Profiles.FirstOrDefault(p => p.NotificationId == notification.NotificationId)); }
public Profile GetProfile(Photo photo, [ScopedService] SocialAppGraphQLContext context) { return(context.Profiles.FirstOrDefault(p => p.ProfileId == photo.ProfileId)); }
public IQueryable <ConstantRoomMember> GetConstantRoomMember([ScopedService] SocialAppGraphQLContext context) { return(context.ConstantRoomMembers); }
public IQueryable <Gender> GetGender([ScopedService] SocialAppGraphQLContext context) { return(context.Genders); }
public IQueryable <Prefer> GetPrefer([ScopedService] SocialAppGraphQLContext context) { return(context.Prefers); }
public IQueryable <Match> GetMatch([ScopedService] SocialAppGraphQLContext context) { return(context.Matches); }
public IQueryable <Profile> GetProfile([ScopedService] SocialAppGraphQLContext context) { return(context.Profiles); }
public IQueryable <ConstantRoom> GetChoices(ChatLevel chatLevel, [ScopedService] SocialAppGraphQLContext context) { return(context.ConstantRooms.Where(c => c.ChatLevelId == chatLevel.ChatLevelId)); }
public IQueryable <Room> GetRoom([ScopedService] SocialAppGraphQLContext context) { return(context.Rooms); }