Пример #1
0
        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));
        }
Пример #2
0
        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));
        }
Пример #3
0
 public IQueryable <ChatLevel> GetChatLevel([ScopedService] SocialAppGraphQLContext context)
 {
     return(context.ChatLevels);
 }
Пример #4
0
 public IQueryable <Bank> GetBank([ScopedService] SocialAppGraphQLContext context)
 {
     return(context.Banks);
 }
Пример #5
0
 public IQueryable <Choice> GetChoice([ScopedService] SocialAppGraphQLContext context)
 {
     return(context.Choices);
 }
Пример #6
0
 public IQueryable <Question> GetQuestion([ScopedService] SocialAppGraphQLContext context)
 {
     return(context.Questions);
 }
Пример #7
0
 public IQueryable <Notification> GetNotification([ScopedService] SocialAppGraphQLContext context)
 {
     return(context.Notifications);
 }
Пример #8
0
 public IQueryable <Like> GetLikes([ScopedService] SocialAppGraphQLContext context)
 {
     return(context.Likes);
 }
Пример #9
0
 public IQueryable <Photo> GetPhoto([ScopedService] SocialAppGraphQLContext context)
 {
     return(context.Photos);
 }
Пример #10
0
 public Profile GetProfile(Prefer prefer, [ScopedService] SocialAppGraphQLContext context)
 {
     return(context.Profiles.FirstOrDefault(p => p.PreferId == p.PreferId));
 }
Пример #11
0
 public IQueryable <Choice> GetChoices(Question question, [ScopedService] SocialAppGraphQLContext context)
 {
     return(context.Choices.Where(c => c.QuestionId == question.QuestionId));
 }
Пример #12
0
 public Question GetQuestion(Choice choice, [ScopedService] SocialAppGraphQLContext context)
 {
     return(context.Questions.FirstOrDefault(q => q.QuestionId == choice.QuestionId));
 }
Пример #13
0
 public Profile GetProfile(Notification notification, [ScopedService] SocialAppGraphQLContext context)
 {
     return(context.Profiles.FirstOrDefault(p => p.NotificationId == notification.NotificationId));
 }
Пример #14
0
 public Profile GetProfile(Photo photo, [ScopedService] SocialAppGraphQLContext context)
 {
     return(context.Profiles.FirstOrDefault(p => p.ProfileId == photo.ProfileId));
 }
Пример #15
0
 public IQueryable <ConstantRoomMember> GetConstantRoomMember([ScopedService] SocialAppGraphQLContext context)
 {
     return(context.ConstantRoomMembers);
 }
Пример #16
0
 public IQueryable <Gender> GetGender([ScopedService] SocialAppGraphQLContext context)
 {
     return(context.Genders);
 }
Пример #17
0
 public IQueryable <Prefer> GetPrefer([ScopedService] SocialAppGraphQLContext context)
 {
     return(context.Prefers);
 }
Пример #18
0
 public IQueryable <Match> GetMatch([ScopedService] SocialAppGraphQLContext context)
 {
     return(context.Matches);
 }
Пример #19
0
 public IQueryable <Profile> GetProfile([ScopedService] SocialAppGraphQLContext context)
 {
     return(context.Profiles);
 }
Пример #20
0
 public IQueryable <ConstantRoom> GetChoices(ChatLevel chatLevel, [ScopedService] SocialAppGraphQLContext context)
 {
     return(context.ConstantRooms.Where(c => c.ChatLevelId == chatLevel.ChatLevelId));
 }
Пример #21
0
 public IQueryable <Room> GetRoom([ScopedService] SocialAppGraphQLContext context)
 {
     return(context.Rooms);
 }