Skip to content

Commit

Permalink
Merge pull request #24 from WorkshopSE/idan_domain_ucc03_0
Browse files Browse the repository at this point in the history
Idan domain ucc03 0
  • Loading branch information
idanizi authored May 23, 2017
2 parents 2b47b93 + fe633eb commit 86a229c
Show file tree
Hide file tree
Showing 60 changed files with 2,557 additions and 348 deletions.
25 changes: 0 additions & 25 deletions Poker.BE/Poker.BE.API.Tests/Controllers/HomeControllerTest.cs

This file was deleted.

60 changes: 0 additions & 60 deletions Poker.BE/Poker.BE.API.Tests/Controllers/ValuesControllerTest.cs

This file was deleted.

5 changes: 3 additions & 2 deletions Poker.BE/Poker.BE.API.Tests/Poker.BE.API.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Controllers\HomeControllerTest.cs" />
<Compile Include="Controllers\ValuesControllerTest.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="App.config" />
Expand All @@ -109,6 +107,9 @@
<Name>Poker.BE.API</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Controllers\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
9 changes: 7 additions & 2 deletions Poker.BE/Poker.BE.API/App_Start/WebApiConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ public static void Register(HttpConfiguration config)
{
// Web API configuration and services

// Setting the configuration for Json Formatting
var jsonFormatter = config.Formatters.JsonFormatter;
jsonFormatter.SerializerSettings.PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.Objects;
config.Formatters.Remove(config.Formatters.XmlFormatter);

// Web API routes
config.MapHttpAttributeRoutes();

config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
routeTemplate: "api/{controller}/{action}/{param}",
defaults: new { param = RouteParameter.Optional }
);
}
}
Expand Down
19 changes: 0 additions & 19 deletions Poker.BE/Poker.BE.API/Controllers/HomeController.cs

This file was deleted.

35 changes: 34 additions & 1 deletion Poker.BE/Poker.BE.API/Controllers/RoomController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
using System;
using Poker.BE.Service.Modules.Requests;
using Poker.BE.Service.Modules.Results;
using Poker.BE.Service.IServices;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
Expand All @@ -9,5 +13,34 @@ namespace Poker.BE.API.Controllers
{
public class RoomController : ApiController
{
#region Fields
private IRoomsService service;
#endregion

#region Constructors
public RoomController()
{
service = new Service.Services.RoomsService();
}
#endregion

#region Methods
[HttpPost]
public HttpResponseMessage EnterRoom(EnterRoomRequest request)
{
var result = default(EnterRoomResult);

try
{
result = service.EnterRoom(request);
}
catch (Exception e)
{
result.ErrorMessage = e.Message;
}

return Request.CreateResponse(HttpStatusCode.OK, result);
}
#endregion
}
}
52 changes: 0 additions & 52 deletions Poker.BE/Poker.BE.API/Controllers/ValuesController.cs

This file was deleted.

2 changes: 2 additions & 0 deletions Poker.BE/Poker.BE.API/Global.asax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);

// TODO: idan - this is MVC adding, clear this
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
Expand Down
14 changes: 6 additions & 8 deletions Poker.BE/Poker.BE.API/Poker.BE.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,13 @@
<Compile Include="Areas\HelpPage\XmlDocumentationProvider.cs" />
<Compile Include="Controllers\AuthenticationController.cs" />
<Compile Include="Controllers\HistoryController.cs" />
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Controllers\LeagueController.cs" />
<Compile Include="Controllers\LevelController.cs" />
<Compile Include="Controllers\MessageController.cs" />
<Compile Include="Controllers\NotificationController.cs" />
<Compile Include="Controllers\PokerGamePlayController.cs" />
<Compile Include="Controllers\ProfileController.cs" />
<Compile Include="Controllers\RoomController.cs" />
<Compile Include="Controllers\ValuesController.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
Expand Down Expand Up @@ -261,18 +259,18 @@
<ItemGroup>
<Content Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Poker.BE.Domain\Poker.BE.Domain.csproj">
<Project>{fe034180-e60e-416e-8d0f-0d9155ac52cc}</Project>
<Name>Poker.BE.Domain</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Scripts\jquery-3.1.1.slim.min.map" />
</ItemGroup>
<ItemGroup>
<Content Include="Scripts\jquery-3.1.1.min.map" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Poker.BE.Service\Poker.BE.Service.csproj">
<Project>{fe55ce81-34e4-49dd-b43d-b62b2490dc34}</Project>
<Name>Poker.BE.Service</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down
5 changes: 5 additions & 0 deletions Poker.BE/Poker.BE.API/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<!--
For more information on how to configure your ASP.NET application, please visit
https://go.microsoft.com/fwlink/?LinkId=301879
TODO: (idan)
* connection strings
* Allow-Cross-To-Origin headers
-->
<configuration>
<appSettings>
Expand Down
Loading

0 comments on commit 86a229c

Please sign in to comment.