├── UsingTask.Service
├── Views
│ ├── _ViewStart.cshtml
│ ├── Shared
│ │ ├── Error.cshtml
│ │ └── _Layout.cshtml
│ ├── Home
│ │ └── Index.cshtml
│ └── Web.config
├── favicon.ico
├── Scripts
│ ├── _references.js
│ ├── respond.min.js
│ ├── jquery.validate.unobtrusive.min.js
│ └── respond.js
├── Global.asax
├── fonts
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.ttf
│ └── glyphicons-halflings-regular.woff
├── Areas
│ └── HelpPage
│ │ ├── Views
│ │ ├── Help
│ │ │ ├── DisplayTemplates
│ │ │ │ ├── ImageSample.cshtml
│ │ │ │ ├── TextSample.cshtml
│ │ │ │ ├── SimpleTypeModelDescription.cshtml
│ │ │ │ ├── ComplexTypeModelDescription.cshtml
│ │ │ │ ├── CollectionModelDescription.cshtml
│ │ │ │ ├── InvalidSample.cshtml
│ │ │ │ ├── DictionaryModelDescription.cshtml
│ │ │ │ ├── KeyValuePairModelDescription.cshtml
│ │ │ │ ├── EnumTypeModelDescription.cshtml
│ │ │ │ ├── Samples.cshtml
│ │ │ │ ├── ModelDescriptionLink.cshtml
│ │ │ │ ├── ApiGroup.cshtml
│ │ │ │ ├── Parameters.cshtml
│ │ │ │ └── HelpPageApiModel.cshtml
│ │ │ ├── ResourceModel.cshtml
│ │ │ ├── Api.cshtml
│ │ │ └── Index.cshtml
│ │ ├── _ViewStart.cshtml
│ │ ├── Shared
│ │ │ └── _Layout.cshtml
│ │ └── Web.config
│ │ ├── ModelDescriptions
│ │ ├── SimpleTypeModelDescription.cs
│ │ ├── DictionaryModelDescription.cs
│ │ ├── CollectionModelDescription.cs
│ │ ├── ParameterAnnotation.cs
│ │ ├── EnumValueDescription.cs
│ │ ├── KeyValuePairModelDescription.cs
│ │ ├── IModelDocumentationProvider.cs
│ │ ├── ModelDescription.cs
│ │ ├── ComplexTypeModelDescription.cs
│ │ ├── EnumTypeModelDescription.cs
│ │ ├── ParameterDescription.cs
│ │ ├── ModelNameAttribute.cs
│ │ └── ModelNameHelper.cs
│ │ ├── SampleGeneration
│ │ ├── SampleDirection.cs
│ │ ├── TextSample.cs
│ │ ├── InvalidSample.cs
│ │ ├── ImageSample.cs
│ │ └── HelpPageSampleKey.cs
│ │ ├── HelpPageAreaRegistration.cs
│ │ ├── ApiDescriptionExtensions.cs
│ │ ├── Controllers
│ │ └── HelpController.cs
│ │ ├── HelpPage.css
│ │ ├── Models
│ │ └── HelpPageApiModel.cs
│ │ ├── App_Start
│ │ └── HelpPageConfig.cs
│ │ └── XmlDocumentationProvider.cs
├── App_Start
│ ├── FilterConfig.cs
│ ├── RouteConfig.cs
│ ├── WebApiConfig.cs
│ ├── BundleConfig.cs
│ ├── IdentityConfig.cs
│ └── Startup.Auth.cs
├── Content
│ └── Site.css
├── Startup.cs
├── Controllers
│ ├── HomeController.cs
│ ├── ValuesController.cs
│ └── PeopleController.cs
├── Global.asax.cs
├── Results
│ └── ChallengeResult.cs
├── Models
│ ├── AccountViewModels.cs
│ ├── IdentityModels.cs
│ └── AccountBindingModels.cs
├── Web.Debug.config
├── Web.Release.config
├── Properties
│ └── AssemblyInfo.cs
├── packages.config
├── Providers
│ └── ApplicationOAuthProvider.cs
├── Web.config
└── Project_Readme.html
├── UsingTask.UI
├── App.config
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── App.xaml.cs
├── Converters.cs
├── MainWindow.xaml.cs
├── MainWindow.xaml
├── UsingTask.UI.csproj
└── App.xaml
├── UsingTask.Tester
├── App.config
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
└── UsingTask.Tester.csproj
├── README.md
├── UsingTask.Shared
├── Person.cs
├── People.cs
├── Properties
│ └── AssemblyInfo.cs
└── UsingTask.Shared.csproj
├── UsingTask.Library
├── Properties
│ └── AssemblyInfo.cs
├── app.config
├── PersonRepository.cs
└── UsingTask.Library.csproj
├── .gitattributes
├── UsingTask.sln
└── .gitignore
/UsingTask.Service/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "~/Views/Shared/_Layout.cshtml";
3 | }
4 |
--------------------------------------------------------------------------------
/UsingTask.Service/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeremybytes/using-task/HEAD/UsingTask.Service/favicon.ico
--------------------------------------------------------------------------------
/UsingTask.Service/Scripts/_references.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeremybytes/using-task/HEAD/UsingTask.Service/Scripts/_references.js
--------------------------------------------------------------------------------
/UsingTask.Service/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="UsingTask.Service.WebApiApplication" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/UsingTask.Service/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeremybytes/using-task/HEAD/UsingTask.Service/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/UsingTask.Service/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeremybytes/using-task/HEAD/UsingTask.Service/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/UsingTask.Service/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeremybytes/using-task/HEAD/UsingTask.Service/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/UsingTask.Service/Areas/HelpPage/Views/Help/DisplayTemplates/ImageSample.cshtml:
--------------------------------------------------------------------------------
1 | @using UsingTask.Service.Areas.HelpPage
2 | @model ImageSample
3 |
4 |
--------------------------------------------------------------------------------
/UsingTask.Service/Areas/HelpPage/Views/Help/DisplayTemplates/TextSample.cshtml:
--------------------------------------------------------------------------------
1 | @using UsingTask.Service.Areas.HelpPage
2 | @model TextSample
3 |
4 |
5 | @Model.Text 6 |-------------------------------------------------------------------------------- /UsingTask.Service/Areas/HelpPage/Views/Help/DisplayTemplates/SimpleTypeModelDescription.cshtml: -------------------------------------------------------------------------------- 1 | @using UsingTask.Service.Areas.HelpPage.ModelDescriptions 2 | @model SimpleTypeModelDescription 3 | @Model.Documentation -------------------------------------------------------------------------------- /UsingTask.UI/App.config: -------------------------------------------------------------------------------- 1 | 2 |
Sample not available.
13 | } -------------------------------------------------------------------------------- /UsingTask.Service/Areas/HelpPage/ModelDescriptions/KeyValuePairModelDescription.cs: -------------------------------------------------------------------------------- 1 | namespace UsingTask.Service.Areas.HelpPage.ModelDescriptions 2 | { 3 | public class KeyValuePairModelDescription : ModelDescription 4 | { 5 | public ModelDescription KeyModelDescription { get; set; } 6 | 7 | public ModelDescription ValueModelDescription { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /UsingTask.Service/Areas/HelpPage/ModelDescriptions/IModelDocumentationProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | 4 | namespace UsingTask.Service.Areas.HelpPage.ModelDescriptions 5 | { 6 | public interface IModelDocumentationProvider 7 | { 8 | string GetDocumentation(MemberInfo member); 9 | 10 | string GetDocumentation(Type type); 11 | } 12 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | using-task 2 | ========== 3 | 4 | Sample project to show how to consume async methods / methods that return Task 5 | 6 | Articles discribing the code are collected here: http://www.jeremybytes.com/Downloads.aspx#Tasks 7 | 8 | **Update** 9 | An update of these code samples using .NET Core 3.1 is available here: [using-task-core3](https://github.com/jeremybytes/using-task-core3). 10 | -------------------------------------------------------------------------------- /UsingTask.Service/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = null; 3 | } 4 | 5 | 6 | 7 | 8 | 9 |10 | @Html.ActionLink("Help Page Home", "Index") 11 |
12 |@Model.Documentation
16 |15 | @Html.ActionLink("Help Page Home", "Index") 16 |
17 |Possible enumeration values:
5 | 6 || Name | Value | Description |
|---|---|---|
| @value.Name | 15 |
16 | @value.Value 17 | |
18 |
19 | @value.Documentation 20 | |
21 |
Sample not available.
22 | } 23 | else 24 | { 25 | @Html.DisplayFor(s => sample); 26 | } 27 | } 28 |28 | Provide a general description of your APIs here. 29 |
30 |@controllerDocumentation
18 | } 19 || API | Description |
|---|---|
| @api.HttpMethod.Method @api.RelativePath | 28 |
29 | @if (api.Documentation != null)
30 | {
31 | @api.Documentation 32 | } 33 | else 34 | { 35 |No documentation available. 36 | } 37 | |
38 |
ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS, and JavaScript.
4 | 5 |ASP.NET Web API is a framework that makes it easy to build HTTP services that reach 10 | a broad range of clients, including browsers and mobile devices. ASP.NET Web API 11 | is an ideal platform for building RESTful applications on the .NET Framework.
12 | 13 |NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.
17 | 18 |You can easily find a web hosting company that offers the right mix of features and price for your applications.
22 | 23 || Name | Description | Type | Additional information |
|---|---|---|---|
| @parameter.Name | 20 |
21 | @parameter.Documentation 22 | |
23 | 24 | @Html.DisplayFor(m => modelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = modelDescription }) 25 | | 26 |
27 | @if (parameter.Annotations.Count > 0)
28 | {
29 | foreach (var annotation in parameter.Annotations)
30 | {
31 | @annotation.Documentation 32 | } 33 | } 34 | else 35 | { 36 |None. 37 | } 38 | |
39 |
None.
47 | } 48 | 49 | -------------------------------------------------------------------------------- /UsingTask.Service/App_Start/IdentityConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Microsoft.AspNet.Identity; 3 | using Microsoft.AspNet.Identity.EntityFramework; 4 | using Microsoft.AspNet.Identity.Owin; 5 | using Microsoft.Owin; 6 | using UsingTask.Service.Models; 7 | 8 | namespace UsingTask.Service 9 | { 10 | // Configure the application user manager used in this application. UserManager is defined in ASP.NET Identity and is used by the application. 11 | 12 | public class ApplicationUserManager : UserManager@description.Documentation
13 | 14 |@Model.RequestDocumentation
22 | 23 | @if (Model.RequestModelDescription != null) 24 | { 25 | @Html.DisplayFor(m => m.RequestModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.RequestModelDescription }) 26 | if (Model.RequestBodyParameters != null) 27 | { 28 | @Html.DisplayFor(m => m.RequestBodyParameters, "Parameters") 29 | } 30 | } 31 | else 32 | { 33 |None.
34 | } 35 | 36 | @if (Model.SampleRequests.Count > 0) 37 | { 38 |@description.ResponseDescription.Documentation
47 | 48 | @if (Model.ResourceDescription != null) 49 | { 50 | @Html.DisplayFor(m => m.ResourceDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ResourceDescription }) 51 | if (Model.ResourceProperties != null) 52 | { 53 | @Html.DisplayFor(m => m.ResourceProperties, "Parameters") 54 | } 55 | } 56 | else 57 | { 58 |None.
59 | } 60 | 61 | @if (Model.SampleResponses.Count > 0) 62 | { 63 |