예제 #1
0
        private void InitializeComplexTypes()
        {
            FieldAsync <UserProfileGraphType, UserProfile>(
                "UserProfile",
                "UserProfile",
                null,
                context =>
            {
                return(_dataStore.GetEntityAsync <UserProfile>(p => p.ProfileId == context.Source.ProfileId, context.CancellationToken));
            });

            FieldAsync <UserGraphType, User>(
                "User",
                "User",
                null,
                context =>
            {
                return(_dataStore.GetEntityAsync <User>(p => p.UserId == context.Source.UserId, context.CancellationToken));
            });

            FieldAsync <FileReferenceGraphType, FileReference>(
                "FileReference",
                "FileReference",
                null,
                context =>
            {
                return(_dataStore.GetEntityAsync <FileReference>(p => p.FileReferenceId == context.Source.FileReferenceId, context.CancellationToken));
            });
        }
예제 #2
0
        private void InitializeComplexTypes()
        {
            FieldAsync <UserGraphType, User>(
                "User",
                "User",
                null,
                context =>
            {
                return(_dataStore.GetEntityAsync <User>(p => p.UserId == context.Source.UserId, context.CancellationToken));
            });

            FieldAsync <ListGraphType <UserProfileFileReferenceGraphType>, IEnumerable <UserProfileFileReference> >
            (
                "UserProfileFileReferences",
                "",
                null,
                context =>
            {
                return(_dataStore.GetBatchedEntitiesAsync <UserProfileFileReference>
                       (
                           "UserProfileFileReferences",
                           context.Source.ProfileId,
                           p => p.ProfileId,
                           context.CancellationToken
                       ));
            });
        }
        public TitleEventPartyGraphType(IEFDataStore dataStore)
        {
            Field(x => x.TitleEventId);
            Field(x => x.PartyId);

            FieldAsync <TitleEventGraphType, TitleEvent>
            (
                FieldNames.TitleEvent,
                "Title event associated with this party",
                null,
                context => dataStore.GetEntityAsync <TitleEvent>(p => p.TitleEventId == context.Source.TitleEventId, context.CancellationToken));
        }
        public TitleEventGovtLotLegalMqlGraphType(IEFDataStore dataStore)
        {
            Field(p => p.UnplattedReferenceId);
            Field(p => p.GovernmentLotId);
            Field(p => p.TitleEventId);

            FieldAsync <TitleEventGraphType, TitleEvent>
            (
                FieldNames.TitleEvent,
                "Title event associated with this gov lot lega mql",
                null,
                context => dataStore.GetEntityAsync <TitleEvent>(p => p.TitleEventId == context.Source.TitleEventId, context.CancellationToken));
        }
예제 #5
0
        public TitleEventLegalEntityMqlGraphType(IEFDataStore dataStore)
        {
            _dataStore = dataStore;

            Field(x => x.TitleEventId);
            Field(x => x.LegalEntityNameId);

            FieldAsync <TitleEventGraphType, TitleEvent>
            (
                FieldNames.TitleEvent,
                "Title event associated with this legal entity mql",
                null,
                context => dataStore.GetEntityAsync <TitleEvent>(p => p.TitleEventId == context.Source.TitleEventId, context.CancellationToken));
        }
        public TitleEventSectionLegalMqlGraphType(IEFDataStore dataStore)
        {
            _dataStore = dataStore;

            Field(p => p.TitleEventId);
            Field(p => p.SectionBreakdownCodeId);
            Field(p => p.UnplattedReferenceId);

            FieldAsync <TitleEventGraphType, TitleEvent>
            (
                FieldNames.TitleEvent,
                "Title event associated with this section legal mql",
                null,
                context => dataStore.GetEntityAsync <TitleEvent>(p => p.TitleEventId == context.Source.TitleEventId, context.CancellationToken));
        }
        public NameSearchListItemGraphType(IEFDataStore dataStore)
        {
            Field(p => p.NameSearchListItemId);
            Field(p => p.LegalEntityNameId);
            Field(p => p.ChainOfTitleId);
            Field(p => p.NameSearchStatusCodeId);
            Field(p => p.ReferenceTitleEventId);

            FieldAsync <TitleEventGraphType, TitleEvent>
            (
                FieldNames.GeographicLocale,
                "Geographic locale for this file reference",
                null,
                context => dataStore.GetEntityAsync <TitleEvent>(p => p.TitleEventId == context.Source.ReferenceTitleEventId, context.CancellationToken));
        }
        public TitleEventOrderTrackingGraphType(IEFDataStore dataStore)
        {
            _dataStore = dataStore;

            Field(p => p.TitleEventId);
            Field(p => p.TitleEventOrderId);
            Field(p => p.DeliveryOrderInfoId);

            FieldAsync <TitleEventGraphType, TitleEvent>
            (
                FieldNames.TitleEvent,
                "Title event associated with this tracked order",
                null,
                context => dataStore.GetEntityAsync <TitleEvent>(p => p.TitleEventId == context.Source.TitleEventId, context.CancellationToken));
        }
        public TitleSearchOriginationGraphType(IEFDataStore dataStore)
        {
            Field(p => p.TitleEventId);
            Field(p => p.TitleSearchOriginationId);
            Field(p => p.OrderDate);
            Field(p => p.OrderReference, true);
            Field(p => p.FileReferenceId);

            FieldAsync <TitleEventGraphType, TitleEvent>
            (
                FieldNames.TitleEvent,
                "Title event associated with this title origination",
                null,
                context => dataStore.GetEntityAsync <TitleEvent>(p => p.TitleEventId == context.Source.TitleEventId, context.CancellationToken));
        }
예제 #10
0
        public TitleEventNotesGraphType(IEFDataStore dataStore)
        {
            _dataStore = dataStore;

            Field(p => p.TitleEventId);
            Field(p => p.UserId, true);
            Field(p => p.TimeStamp);
            Field(p => p.Message, true);

            FieldAsync <TitleEventGraphType, TitleEvent>
            (
                FieldNames.TitleEvent,
                "Title event associated with this title event note",
                null,
                context => dataStore.GetEntityAsync <TitleEvent>(p => p.TitleEventId == context.Source.TitleEventId, context.CancellationToken));
        }
예제 #11
0
        public TitleQuery(IEFDataStore dataStore)
        {
            Name        = "TitleQuery";
            Description = Resources.Queries_for_the_Title_Event_table;

            FieldAsync <ObjectGraphTypes.TitleEventGraphType, TitleEvent>
            (
                FieldNames.TitleEvent,
                Resources.Gets_a_single_title_event_record_by_id,
                new QueryArguments
                (
                    new QueryArgument <IntGraphType>
            {
                Name        = ArgumentNames.TitleEventId,
                Description = "The title event primary key"
            }
                ),
                context =>
            {
                var titleEventId = context.GetArgument <int>(ArgumentNames.TitleEventId);
                return(dataStore.GetEntityAsync <TitleEvent>(p => p.TitleEventId == titleEventId, context.CancellationToken));
            });
        }
예제 #12
0
        public FileReferenceQuery(IEFDataStore dataStore)
        {
            Name              = "FileReferenceQuery";
            Description       = Resources.File_reference_query;
            DeprecationReason = null;

            #region File References By Name

            FieldAsync <ListGraphType <FileReferenceGraphType>, IEnumerable <FileReference> >
            (
                "FileReferencesByName",
                "FileReferences by file reference name",
                new QueryArguments
                (
                    QueryArgumentFactory.Create <StringGraphType>("FileReferenceName", "FileReferenceName")
                ), async context =>
            {
                await Task.Delay(5000);
                var fileReferenceName = context.GetArgument <string>("fileReferenceName");
                return(await dataStore.GetEntitiesAsync <FileReference>
                       (
                           p => p.FileReference1.StartsWith(fileReferenceName),
                           context.CancellationToken
                       ));
            });

            #endregion

            #region File Reference By File Reference Id

            FieldAsync <FileReferenceGraphType, FileReference>
            (
                "FileReferenceById",
                "FileReference by file reference id",
                new QueryArguments
                (
                    QueryArgumentFactory.Create <IntGraphType>(ArgumentNames.FileReferenceId, Resources.The_file_reference_Id)
                ),
                context =>
            {
                var fileReferenceId = context.GetArgument <int>(ArgumentNames.FileReferenceId);
                return(dataStore.GetEntityAsync <FileReference>(p => p.FileReferenceId == fileReferenceId, context.CancellationToken));
            });

            #endregion

            #region User Profile By User Id

            FieldAsync <ListGraphType <UserProfileGraphType>, IEnumerable <UserProfile> >
            (
                "UserProfilesByUserId",
                "Get all user profiles by a user's id",
                new QueryArguments
                (
                    QueryArgumentFactory.Create <IntGraphType>("userId", "Id of user")
                ),
                context =>
            {
                var userId = context.GetArgument <int>("userId");

                return(dataStore.GetEntitiesAsync <UserProfile>
                       (
                           p => p.UserId == userId,
                           context.CancellationToken
                       ));
            });

            #endregion

            #region User Profile By User Id And Profile Id

            FieldAsync <UserProfileGraphType, UserProfile>
            (
                "UserProfileByUserIdAndProfileId",
                "Gets a user's profile using the user id and profile id",
                new QueryArguments
                (
                    QueryArgumentFactory.Create <IntGraphType>("profileId", "Id of user's profile"),
                    QueryArgumentFactory.Create <IntGraphType>("userId", "Id of user")
                ),
                context =>
            {
                var profileId = context.GetArgument <int>("profileId");
                var userId    = context.GetArgument <int>("userId");

                return(dataStore.GetEntityAsync <UserProfile>
                       (
                           p => p.ProfileId == profileId && p.UserId == userId,
                           context.CancellationToken
                       ));
            });

            #endregion
        }