☁️
Flow IFS Cloud Development Guidelines
  • Flow IFS Cloud Development Guidelines
  • 👶Getting started
    • OData Basics
    • IFS Cloud
    • Terminology
    • Useful Applications
    • IFS documentation
      • IFS API Explorer
      • Entity details
    • Setting up the OData connector
      • Configure connection between Flow Server and IFS Cloud
      • Selecting which configurations are visible in Flow Server
  • 👩‍💻Flow Development with OData
    • Architecture
    • Flow development and distribution strategy
    • Implementation
      • Operations in OData machine steps
      • Missing operations
      • Translations
      • Iteration
      • Join data sets
      • Misc Tips and trix
      • Document / Media Library Management
      • Response status handling
        • Errors from IFS
      • Operation specific notes
        • Set input parameters using flow script
        • Update
        • 🛠️WIP - Create
        • Read
    • Configuration
      • Authentication models
        • Setup Client credential flow
        • 🛠️Setup Password credentials flow
        • 🛠️Setup Authorization code flow
        • 🛠️Setup OpenID flow
        • Obtaining Authentication related URLs from IFS Cloud
      • Projection administration
        • Administrating new projections
        • Administrating updated projections
      • Configuring projections in IFS
        • Custom Entities
        • Custom Projections
        • 🛠️WIP - Query Designer
        • Quick Reports
    • Trigger Flows from IFS Cloud
      • Trigger User Flows via External Navigation Links
      • Trigger Machine Flows via BPA using commands
      • 🛠️Trigger Flow via Event Action
    • Debugging and Testing
      • Aurena debugging
        • Inspect in web browser
        • IFS debug console
      • OData Connector Log
  • 🪄Advanced
    • Custom Request
    • C# usage in the OData connector
      • Different methods
      • Building request
      • 🛠️WIP - Code examples
Powered by GitBook
On this page
  • Overview
  • Generated methods signature

Was this helpful?

  1. Advanced

C# usage in the OData connector

Under construction

PreviousCustom RequestNextDifferent methods

Last updated 2 years ago

Was this helpful?

Overview

There are cases when either standard projection operation is missing from specifications (even though the operation exists according to Chrome inspect log) or it just won’t work, one example is when an entity uses an enum as part of it’s key. There is a bug in Microsoft OData Client which prevents that from working.

It does not matter under which Projection you select the Code section to create the C# code.

When opening the code section of first time it looks something like this

In the left part you can see the entity sets available and your own defined classes.

Your code is written in the middle part of the UI. It has some syntax coloring, but other than that, it does not provide much assistance.

The right part, “Flow”, contains whatever variables are available from Flow.

Generated methods signature

First line in the code section is so called signature (= method name and the type) which is automatically generated and cannot be manually modified. It contents will however change automatically based on what you return from the call to flow.

public async System.Threading.Tasks.Task<string> ODataOperation(ODataSource container, FlowVariables flowVariables, System.Net.Http.HttpClient httpClient, System.Threading.CancellationToken token)

Method returns a Task of something (string in the example above) and takes four parameters:

  • flowVariables – a reference to the available flow variables that can be used in the code. Example “flowVariables.userId”,

  • httpClient, an already prepared httpClient (with regard to logging, auth and so forth) that you can use to send requests to the OData endpoint. This is the focus of this document, we’ll return to it shortly and

  • cancellation token where you can (and should) provide whenever you are executing asynchronous operations in your code.

container – a reference to the OData container, a class deriving from This document does not focus on this feature.

🪄
DataServiceContext Class (Microsoft.OData.Client) | Microsoft Docs
Code section is found under each projection
Starting to write new code
Section