-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a core library and a class to retrieve todo items
- Loading branch information
1 parent
3a8a317
commit a5afc14
Showing
4 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Microsoft.Graph; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Todo.Core | ||
{ | ||
public interface ITodoItemRetriever | ||
{ | ||
Task<IEnumerable<OutlookTask>> ListAsync(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Graph.Auth" Version="1.0.0-preview.1" /> | ||
<PackageReference Include="Microsoft.Graph.Beta" Version="0.8.0-preview" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Microsoft.Graph; | ||
|
||
namespace Todo.Core | ||
{ | ||
public class TodoItemRetriever : ITodoItemRetriever | ||
{ | ||
private IAuthenticationProvider AuthenticationProvider { get; } | ||
|
||
public TodoItemRetriever(IAuthenticationProvider authenticationProvider) | ||
{ | ||
AuthenticationProvider = authenticationProvider; | ||
} | ||
|
||
public async Task<IEnumerable<OutlookTask>> ListAsync() | ||
{ | ||
var graphServiceClient = new GraphServiceClient(AuthenticationProvider); | ||
return await graphServiceClient.Me.Outlook.Tasks.Request().GetAsync(); | ||
} | ||
} | ||
} |