added extra method documentation to a dummy controller method to test out the dalsoft package.

removed "RouteController" - redundant now with dalsoft nuget package.
This commit is contained in:
chris.watts90@outlook.com 2017-01-30 20:25:18 +00:00
parent 904ec01118
commit eca081f63d

View File

@ -1,15 +1,9 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.ServiceProcess;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Http;
using DalSoft.WebApi.HelpPage;
using Microsoft.Owin.FileSystems;
@ -77,12 +71,14 @@ namespace WindowsDataCenter
public void Configuration(IAppBuilder appBuilder)
{
var config = new HttpConfiguration();
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
appBuilder.UseWebApi(config);
#if DEBUG
@ -117,6 +113,32 @@ namespace WindowsDataCenter
var respMsg = new HttpResponseMessage(HttpStatusCode.OK);
return ResponseMessage(respMsg);
}
/// <summary>
/// Get unassigned card Ids in the system.
/// </summary>
/// <returns>Json object containing list of unassigned card objects</returns>
/// <example>
/// > Get: http://{baseaddress}:port/api/swipedata/unassigned
/// > Returns:
/// {
/// "data": [
/// {
/// "id": 0,
/// "Id": 0,
/// "UserId": -1,
/// "IsSelected": false,
/// "CardUId": "39c6ec38-3879-4ee6-99ae-0a55777f6b86"
/// }
/// ]
/// }
/// </example>
[HttpGet]
[Route("api/swipedata/unassigned")]
public IHttpActionResult GetUnassignedCards()
{
throw new NotImplementedException();
}
}
public class ValuesController : ApiController
@ -127,28 +149,6 @@ namespace WindowsDataCenter
}
}
public class RouteController : ApiController
{
public IHttpActionResult Get()
{
List<RouteObject> routeList = new List<RouteObject>();
var routes = GlobalConfiguration.Configuration.Routes;
foreach (var route in routes)
{
var obj = new RouteObject();
obj.RouteUrl = route.RouteTemplate;
routeList.Add(obj);
}
return Json(routeList);
}
class RouteObject
{
public string RouteUrl { get; set; }
}
}
public class UsersController : ApiController
{
public IHttpActionResult GetUsers()