Esempio n. 1
0
 public AnswerType(OrgData data)
 {
     Name = "Answer";
     Field <IdGraphType>("Id", resolve: context => context.Source.Id.ToString());
     Field <SessionType>("Session", resolve: context => data.GetSession(context.Source.SessionId));
     Field <QuestionType>("Question", resolve: context => data.GetQuestion(context.Source.QuestionId.ToString()));
     Field <AlternativeType>("Alternative", resolve: context => data.GetAlternative(
                                 context.Source.SessionId,
                                 context.Source.QuestionId,
                                 context.Source.AlternativeId
                                 ));
     Field <PublicUserDataType>("User", resolve: context => data.GetUser(context.Source.UserId.ToString()));
     Field <StringGraphType>("Value", resolve: context => context.Source.Value.ToString());
 }