---
title: "How implement Graph API beta in ASP.NET Core App"  
description: "How implement Graph API beta in ASP.NET Core App"  
author: "Revati S Misra"  
published: 2023-09-05  
updated: 2023-09-06  
canonical: https://www.mindstick.com/forum/159840/how-implement-graph-api-beta-in-asp-dot-net-core-app  
category: "asp.net core"  
tags: [".net", "asp.net core", ".net core"]  
reading_time: 2 minutes  

---

# How implement Graph API beta in ASP.NET Core App

How implement Graph [API](https://www.mindstick.com/articles/12641/instagram-api-upgraded-to-facebook-graph) [beta](https://answers.mindstick.com/qa/30471/what-is-beta-version) in [ASP.NET Core](https://www.mindstick.com/articles/12946/get-started-with-asp-dot-net-core-mvc-and-visual-studio) App

## Replies

### Reply by Aryan Kumar

To implement the Microsoft Graph API beta in an [ASP.NET](https://www.mindstick.com/articles/934/default-folders-available-inside-the-asp-dot-net-application-folder) Core application, you can follow these steps:

1. Install the Microsoft.Graph.Beta package from NuGet.
2. Create a new controller that will expose the Graph API endpoints.
3. In the controller, create a method that calls the Graph API endpoint.
4. Use the `Microsoft.Graph.Beta.GraphServiceClient` class to create a client for the Graph API.
5. Use the `GraphServiceClient` class to call the desired endpoint.
6. Return the results of the call from the method.

Here is an example of how to implement the Microsoft Graph API beta in an ASP.NET Core application:

C#

```plaintext
using Microsoft.Graph.Beta;
using Microsoft.AspNetCore.Mvc;

namespace MyApp.Controllers
{
    public class GraphApiController : Controller
    {
        public async Task<IActionResult> GetMe()
        {
            // Create a client for the Graph API.
            var client = new GraphServiceClient();

            // Call the "me" endpoint.
            var me = await client.Me.Request().GetAsync();

            // Return the results of the call.
            return Ok(me);
        }
    }
}
```

In this example, we first create a controller named `GraphApiController`. The class `GraphApiController` has a method called `GetMe()`. The `GetMe()` method calls the Graph API endpoint “me” and returns the result of the call.

The `GetMe()` method first creates a client for the Graph API using the `GraphServiceClient` class. This method then calls the `Me.Request().GetAsync()` method to call the "me" endpoint. Finally, the method returns the results of the call.


---

Original Source: https://www.mindstick.com/forum/159840/how-implement-graph-api-beta-in-asp-dot-net-core-app

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
