示例#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));
 }
 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);
 }