Skip to content

Commit

Permalink
Merge pull request #1 from panesofglass/master
Browse files Browse the repository at this point in the history
Update Web API lab
  • Loading branch information
dmohl committed Jul 7, 2013
2 parents 3d35d53 + 8bf01d6 commit 51f3be6
Show file tree
Hide file tree
Showing 357 changed files with 23,372 additions and 238 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ x64/
build/
[Bb]in/
[Oo]bj/
test/

# MSTest test Results
[Tt]est[Rr]esult*/
Expand Down Expand Up @@ -130,7 +131,8 @@ publish/

# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/
packages/
.build/

# Windows Azure Build Output
csx
Expand Down
39 changes: 0 additions & 39 deletions WebApi Lab/WebAPI Complete/GuitarExample/Console/Program.fs

This file was deleted.

This file was deleted.

39 changes: 0 additions & 39 deletions WebApi Lab/WebAPI Lab Starter/GuitarExample/Console/Program.fs

This file was deleted.

This file was deleted.

File renamed without changes.
File renamed without changes.
41 changes: 41 additions & 0 deletions WebApiLab/WebAPIComplete/Build.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Root>$(MSBuildThisFileDirectory)</Root>
<SolutionDir>$(Root)</SolutionDir>
<FAKE>$(Root)/packages/FAKE.2.1.204-alpha/tools/FAKE.exe</FAKE>
<FakeTemp>$(Root)/.build/FAKE.tmp</FakeTemp>
</PropertyGroup>
<Target Name="InstallNuGet">
<MakeDir Directories="$(Root)/.nuget" />
<MSBuild Projects="$(Root)/.nuget/NuGet.targets"
Properties="DownloadNuGetExe=true;ProjectDir=$(Root);SolutionDir=$(Root)"
Targets="RestorePackages" />
</Target>
<Target Name="InstallFake"
DependsOnTargets="InstallNuGet"
Condition="!Exists('$(FakeTemp)')">
<MakeDir Directories=".build" />
<Exec Command='"$(Root)/.nuget/nuget.exe" install FAKE -Pre -out .build'
WorkingDirectory="$(Root)"
LogStandardErrorAsError="true"/>
<ItemGroup>
<FAKEExe Include="$(Root)/.build/FAKE*/tools/FAKE.exe" />
</ItemGroup>
<Copy SourceFiles="@(FAKEExe)" DestinationFiles="$(FakeTemp)" />
</Target>
<Target Name="LocateFake" DependsOnTargets="InstallFake">
<ItemGroup>
<FAKE Include="$(Root)/.build/FAKE*/tools/FAKE.exe" />
</ItemGroup>
</Target>
<Target Name="Build" DependsOnTargets="LocateFake">
<Exec Command="&quot;@(FAKE)&quot; boot auto"
WorkingDirectory="$(Root)"
LogStandardErrorAsError="true" />
</Target>
<Target Name="Clean" DependsOnTargets="LocateFake">
<Exec Command="&quot;$(FAKE)&quot; build.fsx Clean"
WorkingDirectory="$(Root)"
LogStandardErrorAsError="true" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GuitarExampleWeb", "GuitarE
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GuitarExampleWebApp", "GuitarExample\GuitarExampleWebApp\GuitarExampleWebApp.fsproj", "{A126575F-C66E-42BF-A70F-655D4C3F0069}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Console", "GuitarExample\Console\Console.fsproj", "{8995A0B8-D7D7-404E-8763-B8687214BF7B}"
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GuitarExampleWebApp.Tests", "tests\GuitarExampleWebApp.Tests\GuitarExampleWebApp.Tests.fsproj", "{8995A0B8-D7D7-404E-8763-B8687214BF7B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{B483A23C-6571-49ED-9B42-8E5B7794C692}"
ProjectSection(SolutionItems) = preProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,15 @@
<Content Include="Index.cshtml" />
<Content Include="Scripts\jquery-1.10.1.min.map" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Content Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GuitarExampleWebApp\GuitarExampleWebApp.fsproj">
<Project>{A126575F-C66E-42BF-A70F-655D4C3F0069}</Project>
<Project>{a126575f-c66e-42bf-a70f-655d4c3f0069}</Project>
<Name>GuitarExampleWebApp</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="packages.config" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,22 @@ module Api =
| MissingGuitar -> return request.CreateResponse(HttpStatusCode.BadRequest)
}

let guitarsResource = route "guitars" (get getGuitars; post postGuitar)
let guitarsResource = route "guitars" (get getGuitars <|> post postGuitar)

(**
* Run the app in ASP.NET
*)
type Global() =
inherit System.Web.HttpApplication()

member this.Start() =
let config = GlobalConfiguration.Configuration
type WebApiConfig() =
static member Register(config: HttpConfiguration) =
config
|> HttpResource.register [ Api.guitarsResource ]
|> ignore

config.Formatters.JsonFormatter.SerializerSettings.ContractResolver <-
Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver()

(**
* Run the app in ASP.NET
*)
type Global() =
inherit System.Web.HttpApplication()
member this.Start() =
WebApiConfig.Register GlobalConfiguration.Configuration
5 changes: 5 additions & 0 deletions WebApiLab/WebAPIComplete/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo off
cls
%WINDIR%\Microsoft.Net\Framework\v4.0.30319\MSBuild.exe Build.proj
pause

Loading

0 comments on commit 51f3be6

Please sign in to comment.