private void InitializeInterfaceInfoQuery(IInterfaceInfoRepository interfaceInfoRepository)
        {
            Field <InterfaceInfoType>(
                "interface",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <IntGraphType> >
            {
                Name        = "id",
                Description = "id of the interface"
            }),
                resolve: context =>
            {
                var id = context.GetArgument <short>("id");
                return(interfaceInfoRepository.Get(id));
            });

            Field <ListGraphType <InterfaceInfoType> >(
                "interfaces",
                resolve: context => interfaceInfoRepository.GetAllQueryable()
                .ToListAsync()
                .Result);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> GetAll()
        {
            var data = await interfaceInfoRepository.GetAllQueryable().ToListAsync();

            return(Ok(data));
        }