Пример #1
0
        protected override void Configure(IObjectTypeDescriptor <LegalPerson> descriptor)
        {
            descriptor.Field(t => t.Name)
            .Resolver(ctx => SubscriberResolvers.GetLegalPersonName(ctx, ctx.Parent <Subscriber>(), ctx.Service <SubscriberAdapter>()));

            descriptor.Field(t => t.OrganizationForm)
            .Resolver(ctx => SubscriberResolvers.GetLegalPersonForm(ctx, ctx.Parent <Subscriber>(), ctx.Service <SubscriberAdapter>()));

            descriptor.Field(t => t.ContactDetails)
            .Resolver(ctx => SubscriberResolvers.GetContactDetails(ctx, ctx.Parent <Subscriber>(), ctx.Service <SubscriberAdapter>()));

            descriptor.Field(t => t.Contracts)
            .Resolver(ctx => SubscriberResolvers.GetContracts(ctx, ctx.Parent <Subscriber>(), ctx.Service <SubscriberAdapter>()));

            descriptor.Field(t => t.Id)
            .Resolver(ctx => ((Entity)ctx.Parent <Subscriber>()).Id);
        }
Пример #2
0
        protected override void Configure(IObjectTypeDescriptor <PhysicalPerson> descriptor)
        {
            descriptor.Field(t => t.Surname)
            .Resolver(ctx => SubscriberResolvers.GetPhysicalPersonSurname(ctx, ctx.Parent <Subscriber>(), ctx.Service <SubscriberAdapter>()));

            descriptor.Field(t => t.Name)
            .Resolver(ctx => SubscriberResolvers.GetPhysicalPersonName(ctx, ctx.Parent <Subscriber>(), ctx.Service <SubscriberAdapter>()));

            descriptor.Field(t => t.MiddleName)
            .Resolver(ctx => SubscriberResolvers.GetPhysicalPersonMiddleName(ctx, ctx.Parent <Subscriber>(), ctx.Service <SubscriberAdapter>()));

            descriptor.Field(t => t.ContactDetails)
            .Resolver(ctx => SubscriberResolvers.GetContactDetails(ctx, ctx.Parent <Subscriber>(), ctx.Service <SubscriberAdapter>()));

            descriptor.Field(t => t.Contracts)
            .Resolver(ctx => SubscriberResolvers.GetContracts(ctx, ctx.Parent <Subscriber>(), ctx.Service <SubscriberAdapter>()));

            descriptor.Field(t => t.Id)
            .Resolver(ctx => ((Entity)ctx.Parent <Subscriber>()).Id);
        }