Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1,032 changes: 1,032 additions & 0 deletions OrderSearchAPI/.vs/OrderSearchAPI/config/applicationhost.config

Large diffs are not rendered by default.

Binary file added OrderSearchAPI/.vs/OrderSearchAPI/v16/.suo
Binary file not shown.
Empty file.
Binary file not shown.
25 changes: 25 additions & 0 deletions OrderSearchAPI/OrderSearchAPI.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29201.188
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderSearchAPI", "OrderSearchAPI\OrderSearchAPI.csproj", "{A1B2BAA4-C659-4AD6-9C69-05649AD0A100}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A1B2BAA4-C659-4AD6-9C69-05649AD0A100}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A1B2BAA4-C659-4AD6-9C69-05649AD0A100}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1B2BAA4-C659-4AD6-9C69-05649AD0A100}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1B2BAA4-C659-4AD6-9C69-05649AD0A100}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8568B0FF-8B25-4CF4-9E62-29F430C256CC}
EndGlobalSection
EndGlobal
136 changes: 136 additions & 0 deletions OrderSearchAPI/OrderSearchAPI/App_Data/orderInfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
[
{
"OrderID": 36,
"ShipperID": 4,
"DriverID": 35,
"CompletionDte": "2018-01-12T05:10:00",
"Status": 10,
"Code": "R4C877FF",
"MSA": 1,
"Duration": "92.00",
"OfferType": 1

},
{
"OrderID": 37,
"ShipperID": 4,
"DriverID": 243,
"CompletionDte": "2018-02-15T05:10:00",
"Status": 10,
"Code": "R47077FF",
"MSA": 1,
"Duration": "43.00",
"OfferType": 1
},
{
"OrderID": 38,
"ShipperID": 4,
"DriverID": 35,
"CompletionDte": "2018-01-31T05:10:00",
"Status": 10,
"Code": "R6453FF",
"MSA": 2,
"Duration": "120.00",
"OfferType": 1
},
{
"OrderID": 39,
"ShipperID": 4,
"DriverID": 35,
"CompletionDte": "2018-01-31T05:10:00",
"Status": 10,
"Code": "R4C877DS",
"MSA": 4,
"Duration": "15.00",
"OfferType": 1
},
{
"OrderID": 40,
"ShipperID": 4,
"DriverID": 35,
"CompletionDte": "2018-01-31T05:10:00",
"Status": 10,
"Code": "R4C9999F",
"MSA": 1,
"Duration": "111.00",
"OfferType": 1
},
{
"OrderID": 41,
"ShipperID": 67,
"DriverID": 35,
"CompletionDte": "2018-01-31T05:10:00",
"Status": 10,
"Code": "R4C87S32",
"MSA": 1,
"Duration": "54.00",
"OfferType": 1
},
{
"OrderID": 42,
"ShipperID": 4,
"DriverID": 35,
"CompletionDte": "2018-01-31T05:10:00",
"Status": 10,
"Code": "R4C87123",
"MSA": 1,
"Duration": "92.00",
"OfferType": 1
},
{
"OrderID": 43,
"ShipperID": 4,
"DriverID": 35,
"CompletionDte": "2018-01-31T05:10:00",
"Status": 10,
"Code": "R42G77FF",
"MSA": 1,
"Duration": "40.00",
"OfferType": 1
},
{
"OrderID": 44,
"ShipperID": 4,
"DriverID": 35,
"CompletionDte": "2018-01-31T05:10:00",
"Status": 10,
"Code": "R4002WFF",
"MSA": 1,
"Duration": "92.00",
"OfferType": 2
},
{
"OrderID": 45,
"ShipperID": 4,
"DriverID": 35,
"CompletionDte": "2018-01-31T05:10:00",
"Status": 20,
"Code": "R400KHFF",
"MSA": 3,
"Duration": "23.00",
"OfferType": 1
},
{
"OrderID": 46,
"ShipperID": 24,
"DriverID": 35,
"CompletionDte": "2018-01-31T05:10:00",
"Status": 61,
"Code": "R4C437FF",
"MSA": 1,
"Duration": "92.00",
"OfferType": 1
},
{
"OrderID": 47,
"ShipperID": 121,
"DriverID": 35,
"CompletionDte": "2018-03-1T05:10:00",
"Status": 10,
"Code": "R422AQF",
"MSA": 1,
"Duration": "66.00",
"OfferType": 2
}

]
27 changes: 27 additions & 0 deletions OrderSearchAPI/OrderSearchAPI/App_Start/BundleConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Web;
using System.Web.Optimization;

namespace OrderSearchAPI
{
public class BundleConfig
{
// For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));

// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at https://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));

bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js"));

bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
}
}
}
13 changes: 13 additions & 0 deletions OrderSearchAPI/OrderSearchAPI/App_Start/FilterConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Web;
using System.Web.Mvc;

namespace OrderSearchAPI
{
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
}
}
23 changes: 23 additions & 0 deletions OrderSearchAPI/OrderSearchAPI/App_Start/RouteConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace OrderSearchAPI
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
}
24 changes: 24 additions & 0 deletions OrderSearchAPI/OrderSearchAPI/App_Start/WebApiConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;

namespace OrderSearchAPI
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API configuration and services

// Web API routes
config.MapHttpAttributeRoutes();

config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System;
using System.Text;
using System.Web;
using System.Web.Http.Description;

namespace OrderSearchAPI.Areas.HelpPage
{
public static class ApiDescriptionExtensions
{
/// <summary>
/// Generates an URI-friendly ID for the <see cref="ApiDescription"/>. E.g. "Get-Values-id_name" instead of "GetValues/{id}?name={name}"
/// </summary>
/// <param name="description">The <see cref="ApiDescription"/>.</param>
/// <returns>The ID as a string.</returns>
public static string GetFriendlyId(this ApiDescription description)
{
string path = description.RelativePath;
string[] urlParts = path.Split('?');
string localPath = urlParts[0];
string queryKeyString = null;
if (urlParts.Length > 1)
{
string query = urlParts[1];
string[] queryKeys = HttpUtility.ParseQueryString(query).AllKeys;
queryKeyString = String.Join("_", queryKeys);
}

StringBuilder friendlyPath = new StringBuilder();
friendlyPath.AppendFormat("{0}-{1}",
description.HttpMethod.Method,
localPath.Replace("/", "-").Replace("{", String.Empty).Replace("}", String.Empty));
if (queryKeyString != null)
{
friendlyPath.AppendFormat("_{0}", queryKeyString.Replace('.', '-'));
}
return friendlyPath.ToString();
}
}
}
Loading