Exemplo n.º 1
0
        public DiseasesType(IDiseaseRepository diseaseRepository)
        {
            Field(x => x.Id, type: typeof(IdGraphType)).Description("Disease Id");
            Field(x => x.Description).Description("Description of a disease");
            Field(x => x.DiseaseName).Description("Name of the Disease");

            FieldAsync <ListGraphType <PersonalDiseasesType>, IReadOnlyCollection <PersonalDisease> >(
                "personsWithDisease", "returns list of persons with this disease",
                resolve: context =>
            {
                return(diseaseRepository.GetPersonsByDiseaseId(context.Source.Id));
            });
        }