Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: allenarthurgay/FederatedOauthConsumer
...
head fork: allenarthurgay/FederatedOauthConsumer
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 55 files changed
  • 0 commit comments
  • 1 contributor
Showing with 956 additions and 349 deletions.
  1. +99 −97 Api.Contracts/Api.Contracts.csproj
  2. +6 −0 Api.Contracts/{dto → DTO}/ApplicationRequest.cs
  3. +1 −1  Api.Contracts/{dto → DTO}/GetUserRequest.cs
  4. +8 −0 Api.Contracts/DTO/RegisterAccountRequest.cs
  5. +2 −0  Api.Contracts/{dto → DTO}/RegisterAccountUserRequest.cs
  6. +2 −0  Api.Contracts/Repositories/IAccountApplicationRepository.cs
  7. +1 −1  Api.Contracts/Repositories/IAccountUserRepository.cs
  8. +22 −0 Api.Contracts/Services/IApplicationBreadService.cs
  9. +14 −0 Api.Contracts/Services/IUserBreadService.cs
  10. +5 −7 Api.Contracts/Services/IUserRegistrationService.cs
  11. +0 −8 Api.Contracts/dto/RegisterAccountRequest.cs
  12. +127 −124 Api.Implementations/Api.Implementations.csproj
  13. +56 −0 Api.Implementations/HandlerMapper.cs
  14. +36 −1 Api.Implementations/Registration.cs
  15. +14 −0 Api.Implementations/Repositories/AccountApplicationRepository.cs
  16. +6 −6 Api.Implementations/Repositories/AccountUserRepository.cs
  17. +9 −11 Api.Implementations/Repositories/BaseDataItemRepository.cs
  18. +57 −0 Api.Implementations/Services/ApplicationBreadService.cs
  19. +45 −0 Api.Implementations/Services/UserBreadService.cs
  20. +24 −7 Api.RestHandlers/Api.RestHandlers.csproj
  21. +21 −0 Api.RestHandlers/Handlers/AddApplicationRequestHandler.cs
  22. +22 −0 Api.RestHandlers/Handlers/AddApplicationServiceRequestHandler.cs
  23. +21 −0 Api.RestHandlers/Handlers/BrowseAccountUsersRequestHandler.cs
  24. +21 −0 Api.RestHandlers/Handlers/BrowseApplicationServicesRequestHandler.cs
  25. +21 −0 Api.RestHandlers/Handlers/BrowseApplicationsRequestHandler.cs
  26. +22 −0 Api.RestHandlers/Handlers/DeleteApplicationRequestHandler.cs
  27. +21 −0 Api.RestHandlers/Handlers/DeleteApplicationServiceRequestHandler.cs
  28. +1 −1  Api.RestHandlers/{ → Handlers}/EmptyExampleHandler.cs
  29. +21 −0 Api.RestHandlers/Handlers/GetApplicationRequestHandler.cs
  30. +1 −1  Api.RestHandlers/{ → Handlers}/GetRegistrationHtmlHandler.cs
  31. +1 −1  Api.RestHandlers/{ → Handlers}/GetServiceTokenForPrincipalIdHandler.cs
  32. +2 −1  Api.RestHandlers/{ → Handlers}/GetSupportedServicesHandler.cs
  33. +21 −0 Api.RestHandlers/Handlers/GetUserRequestHandler.cs
  34. +1 −1  Api.RestHandlers/{ → Handlers}/IsRegisteredForServiceHandler.cs
  35. +22 −0 Api.RestHandlers/Handlers/RegisterAccountRequestHandler.cs
  36. +20 −0 Api.RestHandlers/Handlers/RegisterAccountUserRequestHandler.cs
  37. +1 −1  Api.RestHandlers/{ → Handlers}/RegisterServiceProviderRequestHandler.cs
  38. +1 −1  Api.RestHandlers/{ → Handlers}/RegisterServiceTokenHandler.cs
  39. +41 −0 Api.RestHandlers/RequiresAppRegistrationAttribute.cs
  40. +17 −0 Api.RestHandlers/Validators/ApplicationRequestValidator.cs
  41. +19 −0 Api.RestHandlers/Validators/GetSupportedServicesRequestValidator.cs
  42. +12 −1 Api.RestServiceHost/Api.RestServiceHost.csproj
  43. +4 −1 Api.RestServiceHost/App_Start/AppHost.cs
  44. +11 −14 Core/DataConnectionProvider.cs
  45. +3 −3 Core/IDataConnectionProvider.cs
  46. +1 −1  Core/ServiceRegistration.cs
  47. +1 −0  Data/DataItem.cs
  48. +36 −39 Data/DataItemRepository.cs
  49. +12 −1 Demo/Demo.csproj
  50. +12 −18 FederatedOauthConsumer.sln
  51. BIN  UpgradeLog.htm
  52. +12 −1 YammerService/yammerservice.csproj
  53. BIN  _TeamCity.FederatedOauthConsumer/AssemblyInfoCache.dat
  54. BIN  _TeamCity.FederatedOauthConsumer/ProjectFileDataCache/ShouldUseHostCompilerProvider.cache.dat
  55. BIN  _TeamCity.FederatedOauthConsumer/ProjectModel/projectModel.dat
View
196 Api.Contracts/Api.Contracts.csproj
@@ -1,98 +1,100 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{465D9510-43D7-4C51-8B11-1FB57D6A7C9D}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Api.Contracts</RootNamespace>
- <AssemblyName>Api.Contracts</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Core" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="DTO\AddApplicationRequest.cs" />
- <Compile Include="DTO\AddApplicationServiceRequest.cs" />
- <Compile Include="DTO\ApplicationRequest.cs" />
- <Compile Include="DTO\BrowseAccountUsersRequest.cs" />
- <Compile Include="DTO\BrowseApplicationServicesRequest.cs" />
- <Compile Include="DTO\BrowseApplicationsRequest.cs" />
- <Compile Include="DTO\DeleteApplicationRequest.cs" />
- <Compile Include="DTO\DeleteApplicationServiceRequest.cs" />
- <Compile Include="DTO\EnumerableResponse.cs" />
- <Compile Include="DTO\GetApplicationRequest.cs" />
- <Compile Include="DTO\GetServiceTokenForPrincipalIdResponse.cs" />
- <Compile Include="DTO\GetServiceTokenForPrincipalIdRequest.cs" />
- <Compile Include="DTO\GetUserRequest.cs" />
- <Compile Include="DTO\IsRegisteredForServiceResponse.cs" />
- <Compile Include="DTO\GetRegistrationHtmlRequest.cs" />
- <Compile Include="DTO\GetRegistrationHtmlResponse.cs" />
- <Compile Include="DTO\GetSupportedServicesRequest.cs" />
- <Compile Include="DTO\GetSupportedServicesResponse.cs" />
- <Compile Include="DTO\IsRegisteredForServiceRequest.cs" />
- <Compile Include="DTO\RegisterAccountRequest.cs" />
- <Compile Include="DTO\RegisterAccountUserRequest.cs" />
- <Compile Include="DTO\RegisterServiceProviderRequest.cs" />
- <Compile Include="DTO\RegisterServiceTokenRequest.cs" />
- <Compile Include="EmptyDto.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Repositories\IAccountApplicationRepository.cs" />
- <Compile Include="Repositories\IAccountRepository.cs" />
- <Compile Include="Repositories\IAccountUserRepository.cs" />
- <Compile Include="Repositories\IApplicationRepository.cs" />
- <Compile Include="Repositories\IApplicationServiceRepository.cs" />
- <Compile Include="Repositories\IServiceProviderRepository.cs" />
- <Compile Include="Repositories\ISimpleDataItemRepository.cs" />
- <Compile Include="Repositories\IUserRepository.cs" />
- <Compile Include="Repositories\IUserTokenRepository.cs" />
- <Compile Include="Services\IApplicationAuthenticationService.cs" />
- <Compile Include="Services\IAuthConsumerService.cs" />
- <Compile Include="Services\IAuthProviderInstance.cs" />
- <Compile Include="Services\IAuthProviderFactory.cs" />
- <Compile Include="Services\IUserRegistrationService.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Data\Data.csproj">
- <Project>{B40B33E8-B802-4384-8F22-F7670B060566}</Project>
- <Name>Data</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup />
- <Import Project="$(MSBuildToolsPath)\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.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{465D9510-43D7-4C51-8B11-1FB57D6A7C9D}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Api.Contracts</RootNamespace>
+ <AssemblyName>Api.Contracts</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="DTO\AddApplicationRequest.cs" />
+ <Compile Include="DTO\AddApplicationServiceRequest.cs" />
+ <Compile Include="DTO\ApplicationRequest.cs" />
+ <Compile Include="DTO\BrowseAccountUsersRequest.cs" />
+ <Compile Include="DTO\BrowseApplicationServicesRequest.cs" />
+ <Compile Include="DTO\BrowseApplicationsRequest.cs" />
+ <Compile Include="DTO\DeleteApplicationRequest.cs" />
+ <Compile Include="DTO\DeleteApplicationServiceRequest.cs" />
+ <Compile Include="DTO\EnumerableResponse.cs" />
+ <Compile Include="DTO\GetApplicationRequest.cs" />
+ <Compile Include="DTO\GetServiceTokenForPrincipalIdResponse.cs" />
+ <Compile Include="DTO\GetServiceTokenForPrincipalIdRequest.cs" />
+ <Compile Include="DTO\GetUserRequest.cs" />
+ <Compile Include="DTO\IsRegisteredForServiceResponse.cs" />
+ <Compile Include="DTO\GetRegistrationHtmlRequest.cs" />
+ <Compile Include="DTO\GetRegistrationHtmlResponse.cs" />
+ <Compile Include="DTO\GetSupportedServicesRequest.cs" />
+ <Compile Include="DTO\GetSupportedServicesResponse.cs" />
+ <Compile Include="DTO\IsRegisteredForServiceRequest.cs" />
+ <Compile Include="DTO\RegisterAccountRequest.cs" />
+ <Compile Include="DTO\RegisterAccountUserRequest.cs" />
+ <Compile Include="DTO\RegisterServiceProviderRequest.cs" />
+ <Compile Include="DTO\RegisterServiceTokenRequest.cs" />
+ <Compile Include="EmptyDto.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Repositories\IAccountApplicationRepository.cs" />
+ <Compile Include="Repositories\IAccountRepository.cs" />
+ <Compile Include="Repositories\IAccountUserRepository.cs" />
+ <Compile Include="Repositories\IApplicationRepository.cs" />
+ <Compile Include="Repositories\IApplicationServiceRepository.cs" />
+ <Compile Include="Repositories\IServiceProviderRepository.cs" />
+ <Compile Include="Repositories\ISimpleDataItemRepository.cs" />
+ <Compile Include="Repositories\IUserRepository.cs" />
+ <Compile Include="Repositories\IUserTokenRepository.cs" />
+ <Compile Include="Services\IApplicationAuthenticationService.cs" />
+ <Compile Include="Services\IApplicationBreadService.cs" />
+ <Compile Include="Services\IAuthConsumerService.cs" />
+ <Compile Include="Services\IAuthProviderInstance.cs" />
+ <Compile Include="Services\IAuthProviderFactory.cs" />
+ <Compile Include="Services\IUserBreadService.cs" />
+ <Compile Include="Services\IUserRegistrationService.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Data\Data.csproj">
+ <Project>{B40B33E8-B802-4384-8F22-F7670B060566}</Project>
+ <Name>Data</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup />
+ <Import Project="$(MSBuildToolsPath)\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.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
</Project>
View
6 Api.Contracts/dto/ApplicationRequest.cs → Api.Contracts/DTO/ApplicationRequest.cs
@@ -1,3 +1,5 @@
+using Data;
+
namespace Api.Contracts.Dto
{
public abstract class ApplicationRequest
@@ -5,5 +7,9 @@ public abstract class ApplicationRequest
public string AppKey { get; set; }
public string AppSecret { get; set; }
+
+ public Application Application { get; set; }
+
+ public Account Account { get; set; }
}
}
View
2  Api.Contracts/dto/GetUserRequest.cs → Api.Contracts/DTO/GetUserRequest.cs
@@ -4,7 +4,7 @@ namespace Api.Contracts.DTO
{
public class GetUserRequest: ApplicationRequest
{
- public string Id { get; set; }
+ public int Id { get; set; }
public string UserId { get; set; }
}
View
8 Api.Contracts/DTO/RegisterAccountRequest.cs
@@ -0,0 +1,8 @@
+namespace Api.Contracts.DTO
+{
+ public class RegisterAccountRequest
+ {
+
+ }
+
+}
View
2  Api.Contracts/dto/RegisterAccountUserRequest.cs → Api.Contracts/DTO/RegisterAccountUserRequest.cs
@@ -1,8 +1,10 @@
using Api.Contracts.Dto;
+using Data;
namespace Api.Contracts.DTO
{
public class RegisterAccountUserRequest : ApplicationRequest
{
+ public User User { get; set; }
}
}
View
2  Api.Contracts/Repositories/IAccountApplicationRepository.cs
@@ -6,5 +6,7 @@ namespace Api.Contracts.Repositories
public interface IAccountApplicationRepository : ISimpleDataItemRepository<AccountApplication>
{
IEnumerable<AccountApplication> GetForAccount(int accountId);
+
+ Account GetForApplication(int applicationId);
}
}
View
2  Api.Contracts/Repositories/IAccountUserRepository.cs
@@ -5,6 +5,6 @@ namespace Api.Contracts.Repositories
{
public interface IAccountUserRepository : ISimpleDataItemRepository<AccountUser>
{
- IEnumerable<AccountUser> GetForAccount(int accountId);
+ IEnumerable<User> GetForAccount(int accountId);
}
}
View
22 Api.Contracts/Services/IApplicationBreadService.cs
@@ -0,0 +1,22 @@
+using Api.Contracts.DTO;
+using Data;
+
+namespace Api.Contracts.Services
+{
+ public interface IApplicationBreadService
+ {
+ Application GetApplication(GetApplicationRequest request);
+
+ Application RegisterApplicationForAccount(AddApplicationRequest request);
+
+ ApplicationService RegisterServiceForApplication(AddApplicationServiceRequest request);
+
+ EnumerableResponse<ApplicationService> BrowseServicesForApplication(BrowseApplicationServicesRequest request);
+
+ EnumerableResponse<Application> BrowseApplications(BrowseApplicationsRequest request);
+
+ void DeleteApplication(DeleteApplicationRequest request);
+
+ void DeleteApplicationService(DeleteApplicationServiceRequest request);
+ }
+}
View
14 Api.Contracts/Services/IUserBreadService.cs
@@ -0,0 +1,14 @@
+using Api.Contracts.DTO;
+using Data;
+
+namespace Api.Contracts.Services
+{
+ public interface IUserBreadService
+ {
+ EnumerableResponse<User> BrowseUsersForAccount(BrowseAccountUsersRequest request);
+
+ User RegisterUserForAccount(RegisterAccountUserRequest request);
+
+ User GetUser(GetUserRequest request);
+ }
+}
View
12 Api.Contracts/Services/IUserRegistrationService.cs
@@ -1,15 +1,13 @@
-using Data;
+using Api.Contracts.DTO;
+using Data;
namespace Api.Contracts.Services
{
public interface IAccountRegistrationService
{
- void RegisterUser(RegisterUser request);
+ void RegisterAccountForUser(RegisterAccountRequest request);
- void RegisterAccountForUser(RegisterAccount request);
-
- void RegisterAuthServiceForAccount(RegisterAuthServiceProvider request);
-
+ void RegisterAuthServiceForAccount(RegisterAuthServiceProvider request);
}
public class RegisterAuthServiceProvider
@@ -20,7 +18,7 @@ public class RegisterAccount
{
}
- public class RegisterUser
+ public class RegisterUserRequest
{
}
View
8 Api.Contracts/dto/RegisterAccountRequest.cs
@@ -1,8 +0,0 @@
-using Api.Contracts.Dto;
-
-namespace Api.Contracts.DTO
-{
- public class RegisterAccountRequest : ApplicationRequest
- {
- }
-}
View
251 Api.Implementations/Api.Implementations.csproj
@@ -1,125 +1,128 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{6B511690-28B0-400D-97EA-8EE7B3046F91}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Api.Implementations</RootNamespace>
- <AssemblyName>Api.Implementations</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="ServiceStack, Version=3.9.4.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\ServiceStack.3.9.5\lib\net40\ServiceStack.dll</HintPath>
- </Reference>
- <Reference Include="ServiceStack.Common, Version=3.9.4.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\ServiceStack.Common.3.9.5\lib\net35\ServiceStack.Common.dll</HintPath>
- </Reference>
- <Reference Include="ServiceStack.Interfaces, Version=3.9.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\ServiceStack.Common.3.9.5\lib\net35\ServiceStack.Interfaces.dll</HintPath>
- </Reference>
- <Reference Include="ServiceStack.OrmLite, Version=3.9.5.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\ServiceStack.OrmLite.SqlServer.3.9.5\lib\ServiceStack.OrmLite.dll</HintPath>
- </Reference>
- <Reference Include="ServiceStack.OrmLite.SqlServer, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\packages\ServiceStack.OrmLite.SqlServer.3.9.5\lib\ServiceStack.OrmLite.SqlServer.dll</HintPath>
- </Reference>
- <Reference Include="ServiceStack.Razor">
- <HintPath>..\packages\ServiceStack.3.9.5\lib\net40\ServiceStack.Razor.dll</HintPath>
- </Reference>
- <Reference Include="ServiceStack.Redis">
- <HintPath>..\packages\ServiceStack.Redis.3.9.5\lib\net35\ServiceStack.Redis.dll</HintPath>
- </Reference>
- <Reference Include="ServiceStack.ServiceInterface, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\ServiceStack.3.9.5\lib\net40\ServiceStack.ServiceInterface.dll</HintPath>
- </Reference>
- <Reference Include="ServiceStack.Text, Version=3.9.5.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\ServiceStack.Text.3.9.5\lib\net35\ServiceStack.Text.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Configuration" />
- <Reference Include="System.Core" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Registration.cs" />
- <Compile Include="Repositories\AccountApplicationRepository.cs" />
- <Compile Include="Repositories\AccountRepository.cs" />
- <Compile Include="Repositories\AccountUserRepository.cs" />
- <Compile Include="Repositories\ApplicationRepository.cs" />
- <Compile Include="Repositories\ApplicationServiceRepository.cs" />
- <Compile Include="Repositories\BaseDataItemRepository.cs" />
- <Compile Include="Repositories\ServiceProviderRepository.cs" />
- <Compile Include="Repositories\UserRepository.cs" />
- <Compile Include="Repositories\UserTokenRecordRepository.cs" />
- <Compile Include="Services\ApplicationAuthenticationService.cs" />
- <Compile Include="Services\AuthConsumerService.cs" />
- <Compile Include="Services\AuthProviderFactory.cs" />
- <Compile Include="Services\FacebookAuthProviderInstance.cs" />
- <Compile Include="Services\YammerAuthProviderInstance.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Api.Contracts\Api.Contracts.csproj">
- <Project>{465D9510-43D7-4C51-8B11-1FB57D6A7C9D}</Project>
- <Name>Api.Contracts</Name>
- </ProjectReference>
- <ProjectReference Include="..\Core\Core.csproj">
- <Project>{1F902AAD-9A34-4530-A3E3-62B0F31A38A5}</Project>
- <Name>Core</Name>
- </ProjectReference>
- <ProjectReference Include="..\Data\Data.csproj">
- <Project>{B40B33E8-B802-4384-8F22-F7670B060566}</Project>
- <Name>Data</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <Resource Include="Templates\facebook.htm" />
- </ItemGroup>
- <ItemGroup>
- <None Include="packages.config" />
- </ItemGroup>
- <ItemGroup>
- <Folder Include="Handlers\" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\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.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{6B511690-28B0-400D-97EA-8EE7B3046F91}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Api.Implementations</RootNamespace>
+ <AssemblyName>Api.Implementations</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="ServiceStack, Version=3.9.4.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\ServiceStack.3.9.5\lib\net40\ServiceStack.dll</HintPath>
+ </Reference>
+ <Reference Include="ServiceStack.Common, Version=3.9.4.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\ServiceStack.Common.3.9.5\lib\net35\ServiceStack.Common.dll</HintPath>
+ </Reference>
+ <Reference Include="ServiceStack.Interfaces, Version=3.9.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\ServiceStack.Common.3.9.5\lib\net35\ServiceStack.Interfaces.dll</HintPath>
+ </Reference>
+ <Reference Include="ServiceStack.OrmLite, Version=3.9.5.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\ServiceStack.OrmLite.SqlServer.3.9.5\lib\ServiceStack.OrmLite.dll</HintPath>
+ </Reference>
+ <Reference Include="ServiceStack.OrmLite.SqlServer, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\packages\ServiceStack.OrmLite.SqlServer.3.9.5\lib\ServiceStack.OrmLite.SqlServer.dll</HintPath>
+ </Reference>
+ <Reference Include="ServiceStack.Razor">
+ <HintPath>..\packages\ServiceStack.3.9.5\lib\net40\ServiceStack.Razor.dll</HintPath>
+ </Reference>
+ <Reference Include="ServiceStack.Redis">
+ <HintPath>..\packages\ServiceStack.Redis.3.9.5\lib\net35\ServiceStack.Redis.dll</HintPath>
+ </Reference>
+ <Reference Include="ServiceStack.ServiceInterface, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\ServiceStack.3.9.5\lib\net40\ServiceStack.ServiceInterface.dll</HintPath>
+ </Reference>
+ <Reference Include="ServiceStack.Text, Version=3.9.5.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\ServiceStack.Text.3.9.5\lib\net35\ServiceStack.Text.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Configuration" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="HandlerMapper.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Registration.cs" />
+ <Compile Include="Repositories\AccountApplicationRepository.cs" />
+ <Compile Include="Repositories\AccountRepository.cs" />
+ <Compile Include="Repositories\AccountUserRepository.cs" />
+ <Compile Include="Repositories\ApplicationRepository.cs" />
+ <Compile Include="Repositories\ApplicationServiceRepository.cs" />
+ <Compile Include="Repositories\BaseDataItemRepository.cs" />
+ <Compile Include="Repositories\ServiceProviderRepository.cs" />
+ <Compile Include="Repositories\UserRepository.cs" />
+ <Compile Include="Repositories\UserTokenRecordRepository.cs" />
+ <Compile Include="Services\ApplicationAuthenticationService.cs" />
+ <Compile Include="Services\ApplicationBreadService.cs" />
+ <Compile Include="Services\AuthConsumerService.cs" />
+ <Compile Include="Services\AuthProviderFactory.cs" />
+ <Compile Include="Services\FacebookAuthProviderInstance.cs" />
+ <Compile Include="Services\UserBreadService.cs" />
+ <Compile Include="Services\YammerAuthProviderInstance.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Api.Contracts\Api.Contracts.csproj">
+ <Project>{465D9510-43D7-4C51-8B11-1FB57D6A7C9D}</Project>
+ <Name>Api.Contracts</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Core\Core.csproj">
+ <Project>{1F902AAD-9A34-4530-A3E3-62B0F31A38A5}</Project>
+ <Name>Core</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Data\Data.csproj">
+ <Project>{B40B33E8-B802-4384-8F22-F7670B060566}</Project>
+ <Name>Data</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Templates\facebook.htm" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="Handlers\" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\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.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
</Project>
View
56 Api.Implementations/HandlerMapper.cs
@@ -0,0 +1,56 @@
+using System;
+using System.Collections.Generic;
+
+namespace Api.Implementations
+{
+ public interface IHandlerMapper
+ {
+ /// <summary>
+ ///
+ /// </summary>
+ /// <typeparam name="T">Request DTO</typeparam>
+ /// <typeparam name="TU">Response DTO</typeparam>
+ void Register(Type dtoType, Func<object, object> handler);
+
+
+ object Publish<T>(T dto);
+ }
+
+ public class HandlerMapper : IHandlerMapper
+ {
+ private readonly Dictionary<string, Func<object, object>> _handlers;
+
+ public HandlerMapper()
+ {
+ _handlers = new Dictionary<string, Func<object, object>>();
+ }
+ /// <summary>
+ ///
+ /// </summary>
+ /// <typeparam name="T">Request DTO</typeparam>
+ /// <typeparam name="TU">Response DTO</typeparam>
+ public void Register(Type dtoType, Func<object, object> handler)
+ {
+
+ var handlerKey = GetKey(dtoType);
+
+ _handlers.Add(handlerKey, o => handler(o));
+ }
+
+ public object Publish<T>(T dto)
+ {
+ var handlerKey = GetKey(default(T));
+ if (_handlers.ContainsKey(handlerKey))
+ {
+ var func = _handlers[handlerKey];
+ return func(dto);
+ }
+ throw new InvalidOperationException();
+ }
+
+ private static string GetKey(object o)
+ {
+ return o.GetType().FullName;
+ }
+ }
+}
View
37 Api.Implementations/Registration.cs
@@ -1,21 +1,33 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using Api.Contracts.DTO;
using Api.Contracts.Repositories;
using Api.Contracts.Services;
using Api.Implementations.Repositories;
using Api.Implementations.Services;
using Core;
+using Data;
using Funq;
namespace Api.Implementations
{
public class Registration : IFunqRegistrationModule
{
+ public IHandlerMapper Mapper;
+
+
public void RegisterDependencies(Container container)
{
container.Register<IAuthConsumerService>(c => new AuthConsumerService(c.Resolve<IUserTokenRepository>(),
c.Resolve<IServiceProviderRepository>(),
c.Resolve<IAuthProviderFactory>()));
+ container.Register<IUserBreadService>(
+ c => new UserBreadService(c.Resolve<IAccountUserRepository>(), c.Resolve<IUserRepository>()));
+
+
container.Register<IApplicationAuthenticationService>(
c => new ApplicationAuthenticationService(c.Resolve<IApplicationRepository>()));
@@ -27,6 +39,29 @@ public void RegisterDependencies(Container container)
});
RegisterRepositories(container);
+
+
+ // Mapper.Register<RegisterAccountUserRequest, User>(UserBreadService.RegisterUserForAccount);
+
+ }
+
+ private void MapDtos(Container container)
+ {
+ var instance = container.Resolve<IUserBreadService>();
+
+ var methods = instance.GetType().GetMethods(BindingFlags.Public | BindingFlags.Instance);
+
+ var methodsWithOneParam = methods.Where(m => m.GetParameters().Length > 0);
+
+ foreach (var methodInfo in methodsWithOneParam)
+ {
+ var paraminfos =
+ methodInfo.GetParameters();
+
+ var paramType = paraminfos[0].GetType();
+ var m = methodInfo;
+ Mapper.Register(paramType, (t)=> m.Invoke(instance, new[] {t}));
+ }
}
private static void RegisterRepositories(Container container)
View
14 Api.Implementations/Repositories/AccountApplicationRepository.cs
@@ -22,5 +22,19 @@ public IEnumerable<AccountApplication> GetForAccount(int accountId)
AccountId = accountId
}));
}
+
+ public Account GetForApplication(int applicationId)
+ {
+ return ConnectionProvider.ExecuteQuery(c =>
+ {
+ var accountApplication = c.Where<AccountApplication>(new
+ {
+ ApplicationId = applicationId
+ }).FirstOrDefault();
+
+ return c.Where<Account>(new {Id = accountApplication.AccountId}).FirstOrDefault();
+ });
+
+ }
}
}
View
12 Api.Implementations/Repositories/AccountUserRepository.cs
@@ -12,13 +12,13 @@ public AccountUserRepository(IDataConnectionProvider connectionProvider) : base(
{
}
- public IEnumerable<AccountUser> GetForAccount(int accountId)
+ public IEnumerable<User> GetForAccount(int accountId)
{
- return ConnectionProvider.ExecuteQuery(c =>
- c.Where<AccountUser>(new
- {
- AccountId = accountId
- }));
+ return ConnectionProvider.ExecuteQuery(c => c.Select<User>(
+ string.Format(
+ "Select * from User u INNER JOIN AccountUser au ON u.Id=au.UserId where " +
+ " au.AccountId={0}",
+ accountId)));
}
}
}
View
20 Api.Implementations/Repositories/BaseDataItemRepository.cs
@@ -84,30 +84,28 @@ public IEnumerable<T> GetValues(int page, int pagesize)
public T GetById(int id)
{
- using (var dbConn = ConnectionProvider.OpenConnection())
- using (var dbCmd = dbConn.CreateCommand())
+ using (var dbConn = ConnectionProvider.OpenConnection())
{
- var items = dbCmd.Where<T>(new { Id = id });
+ var items = dbConn.Where<T>(new { Id = id });
return items.FirstOrDefault();
}
}
public IEnumerable<T> GetValues(Status status, int page, int pagesize)
{
- using (var dbConn = ConnectionProvider.OpenConnection())
- using (var dbCmd = dbConn.CreateCommand())
- {
- var items = dbCmd.Where<T>(new { Status = (int)status });
- return items.Select(i => i).OrderBy(c => c.Created).Skip((page - 1) * pagesize).Take(pagesize);
- }
+ return ConnectionProvider.ExecuteQuery(conn =>
+ {
+ var items = conn.Where<T>(new { Status = (int)status });
+ return items.Select(i => i).OrderBy(c => c.Created).Skip((page - 1)*pagesize).Take(pagesize);
+ });
}
- public static T GetById(int id, IDbCommand cmd = null)
+ public static T GetById(int id, IDbConnection cmd = null)
{
return cmd.SingleWhere<T>("Id", id);
}
- protected long AddGlobal(IDbCommand cmd, T dataitem)
+ protected long AddGlobal(IDbConnection cmd, T dataitem)
{
var item = GetById(dataitem.Id, cmd);
if (item != null)
View
57 Api.Implementations/Services/ApplicationBreadService.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Api.Contracts.DTO;
+using Api.Contracts.Repositories;
+using Api.Contracts.Services;
+using Data;
+
+namespace Api.Implementations.Services
+{
+ public class ApplicationBreadService : IApplicationBreadService
+ {
+ private readonly IAccountApplicationRepository _accountApplicationRepository;
+ private readonly IApplicationRepository _applicationRepository;
+
+ public ApplicationBreadService(IAccountApplicationRepository accountApplicationRepository)
+ {
+ _accountApplicationRepository = accountApplicationRepository;
+ }
+
+ public Application GetApplication(GetApplicationRequest request)
+ {
+ return request.Application;
+ }
+
+ public Application RegisterApplicationForAccount(AddApplicationRequest request)
+ {
+ throw new NotImplementedException();
+ }
+
+ public ApplicationService RegisterServiceForApplication(AddApplicationServiceRequest request)
+ {
+ throw new NotImplementedException();
+ }
+
+ public EnumerableResponse<ApplicationService> BrowseServicesForApplication(BrowseApplicationServicesRequest request)
+ {
+ throw new NotImplementedException();
+ }
+
+ public EnumerableResponse<Application> BrowseApplications(BrowseApplicationsRequest request)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void DeleteApplication(DeleteApplicationRequest request)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void DeleteApplicationService(DeleteApplicationServiceRequest request)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
View
45 Api.Implementations/Services/UserBreadService.cs
@@ -0,0 +1,45 @@
+using System.Linq;
+using Api.Contracts.DTO;
+using Api.Contracts.Repositories;
+using Api.Contracts.Services;
+using Data;
+
+namespace Api.Implementations.Services
+{
+ public class UserBreadService : IUserBreadService
+ {
+ private readonly IAccountUserRepository _accountUserRepository;
+ private readonly IUserRepository _userRepository;
+
+
+ public UserBreadService(IAccountUserRepository accountUserRepository,
+ IUserRepository userRepository)
+ {
+ _accountUserRepository = accountUserRepository;
+ _userRepository = userRepository;
+ }
+
+ public EnumerableResponse<User> BrowseUsersForAccount(BrowseAccountUsersRequest request)
+ {
+ return new EnumerableResponse<User>
+ {
+ Items = _accountUserRepository.GetForAccount(request.Account.Id).ToList()
+ };
+ }
+
+ public User RegisterUserForAccount(RegisterAccountUserRequest request)
+ {
+ _accountUserRepository.Add(new AccountUser
+ {
+ UserId = request.User.Id,
+ AccountId = request.Account.Id
+ });
+ return request.User;
+ }
+
+ public User GetUser(GetUserRequest request)
+ {
+ return _userRepository.GetById(request.Id);
+ }
+ }
+}
View
31 Api.RestHandlers/Api.RestHandlers.csproj
@@ -68,15 +68,28 @@
</ItemGroup>
<ItemGroup>
<Compile Include="ApiRegistration.cs" />
- <Compile Include="EmptyExampleHandler.cs" />
- <Compile Include="GetRegistrationHtmlHandler.cs" />
- <Compile Include="GetServiceTokenForPrincipalIdHandler.cs" />
- <Compile Include="GetSupportedServicesHandler.cs" />
- <Compile Include="IsRegisteredForServiceHandler.cs" />
+ <Compile Include="Handlers\AddApplicationRequestHandler.cs" />
+ <Compile Include="Handlers\AddApplicationServiceRequestHandler.cs" />
+ <Compile Include="Handlers\BrowseAccountUsersRequestHandler.cs" />
+ <Compile Include="Handlers\BrowseApplicationServicesRequestHandler.cs" />
+ <Compile Include="Handlers\BrowseApplicationsRequestHandler.cs" />
+ <Compile Include="Handlers\DeleteApplicationRequestHandler.cs" />
+ <Compile Include="Handlers\DeleteApplicationServiceRequestHandler.cs" />
+ <Compile Include="Handlers\EmptyExampleHandler.cs" />
+ <Compile Include="Handlers\GetApplicationRequestHandler.cs" />
+ <Compile Include="Handlers\GetRegistrationHtmlHandler.cs" />
+ <Compile Include="Handlers\GetServiceTokenForPrincipalIdHandler.cs" />
+ <Compile Include="Handlers\GetSupportedServicesHandler.cs" />
+ <Compile Include="Handlers\GetUserRequestHandler.cs" />
+ <Compile Include="Handlers\IsRegisteredForServiceHandler.cs" />
+ <Compile Include="Handlers\RegisterAccountRequestHandler.cs" />
+ <Compile Include="Handlers\RegisterAccountUserRequestHandler.cs" />
+ <Compile Include="Handlers\RegisterServiceProviderRequestHandler.cs" />
+ <Compile Include="Handlers\RegisterServiceTokenHandler.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="RegisterServiceProviderRequestHandler.cs" />
- <Compile Include="RegisterServiceTokenHandler.cs" />
<Compile Include="RequiresAppRegistrationAttribute.cs" />
+ <Compile Include="Validators\ApplicationRequestValidator.cs" />
+ <Compile Include="Validators\GetSupportedServicesRequestValidator.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
@@ -86,6 +99,10 @@
<Project>{465D9510-43D7-4C51-8B11-1FB57D6A7C9D}</Project>
<Name>Api.Contracts</Name>
</ProjectReference>
+ <ProjectReference Include="..\Api.Implementations\Api.Implementations.csproj">
+ <Project>{6B511690-28B0-400D-97EA-8EE7B3046F91}</Project>
+ <Name>Api.Implementations</Name>
+ </ProjectReference>
<ProjectReference Include="..\Data\Data.csproj">
<Project>{B40B33E8-B802-4384-8F22-F7670B060566}</Project>
<Name>Data</Name>
View
21 Api.RestHandlers/Handlers/AddApplicationRequestHandler.cs
@@ -0,0 +1,21 @@
+using Api.Contracts.DTO;
+using Api.Contracts.Services;
+using ServiceStack.ServiceInterface;
+
+namespace Api.RestHandlers.Handlers
+{
+ public class AddApplicationRequestHandler : RestServiceBase<AddApplicationRequest>
+ {
+ private readonly IApplicationBreadService _applicationBreadService;
+
+ public AddApplicationRequestHandler(IApplicationBreadService applicationBreadService)
+ {
+ _applicationBreadService = applicationBreadService;
+ }
+
+ public override object OnPut(AddApplicationRequest request)
+ {
+ return _applicationBreadService.RegisterApplicationForAccount(request);
+ }
+ }
+}
View
22 Api.RestHandlers/Handlers/AddApplicationServiceRequestHandler.cs
@@ -0,0 +1,22 @@
+using Api.Contracts.DTO;
+using Api.Contracts.Services;
+using ServiceStack.ServiceInterface;
+
+namespace Api.RestHandlers.Handlers
+{
+ [RequiresAppRegistration(Priority = -1, ApplyTo = ApplyTo.All)]
+ public class AddApplicationServiceRequestHandler : RestServiceBase<AddApplicationServiceRequest>
+ {
+ private readonly IApplicationBreadService _applicationBreadService;
+
+ public AddApplicationServiceRequestHandler(IApplicationBreadService applicationBreadService)
+ {
+ _applicationBreadService = applicationBreadService;
+ }
+
+ public override object OnPut(AddApplicationServiceRequest request)
+ {
+ return _applicationBreadService.RegisterServiceForApplication(request);
+ }
+ }
+}
View
21 Api.RestHandlers/Handlers/BrowseAccountUsersRequestHandler.cs
@@ -0,0 +1,21 @@
+using Api.Contracts.DTO;
+using Api.Contracts.Services;
+using ServiceStack.ServiceInterface;
+
+namespace Api.RestHandlers.Handlers
+{
+ public class BrowseAccountUsersRequestHandler : RestServiceBase<BrowseAccountUsersRequest>
+ {
+ private readonly IUserBreadService _userBreadService;
+
+ public BrowseAccountUsersRequestHandler(IUserBreadService userBreadService)
+ {
+ _userBreadService = userBreadService;
+ }
+
+ public override object OnGet(BrowseAccountUsersRequest request)
+ {
+ return _userBreadService.BrowseUsersForAccount(request);
+ }
+ }
+}
View
21 Api.RestHandlers/Handlers/BrowseApplicationServicesRequestHandler.cs
@@ -0,0 +1,21 @@
+using Api.Contracts.DTO;
+using Api.Contracts.Services;
+using ServiceStack.ServiceInterface;
+
+namespace Api.RestHandlers.Handlers
+{
+ public class BrowseApplicationServicesRequestHandler : RestServiceBase<BrowseApplicationServicesRequest>
+ {
+ private readonly IApplicationBreadService _applicationBreadService;
+
+ public BrowseApplicationServicesRequestHandler(IApplicationBreadService applicationBreadService)
+ {
+ _applicationBreadService = applicationBreadService;
+ }
+
+ public override object OnGet(BrowseApplicationServicesRequest request)
+ {
+ return _applicationBreadService.BrowseServicesForApplication(request);
+ }
+ }
+}
View
21 Api.RestHandlers/Handlers/BrowseApplicationsRequestHandler.cs
@@ -0,0 +1,21 @@
+using Api.Contracts.DTO;
+using Api.Contracts.Services;
+using ServiceStack.ServiceInterface;
+
+namespace Api.RestHandlers.Handlers
+{
+ public class BrowseApplicationsRequestHandler : RestServiceBase<BrowseApplicationsRequest>
+ {
+ private readonly IApplicationBreadService _applicationBreadService;
+
+ public BrowseApplicationsRequestHandler(IApplicationBreadService applicationBreadService)
+ {
+ _applicationBreadService = applicationBreadService;
+ }
+
+ public override object OnGet(BrowseApplicationsRequest request)
+ {
+ return _applicationBreadService.BrowseApplications(request);
+ }
+ }
+}
View
22 Api.RestHandlers/Handlers/DeleteApplicationRequestHandler.cs
@@ -0,0 +1,22 @@
+using Api.Contracts.DTO;
+using Api.Contracts.Services;
+using ServiceStack.ServiceInterface;
+
+namespace Api.RestHandlers.Handlers
+{
+ public class DeleteApplicationRequestHandler : RestServiceBase<DeleteApplicationRequest>
+ {
+ private readonly IApplicationBreadService _applicationBreadService;
+
+ public DeleteApplicationRequestHandler(IApplicationBreadService applicationBreadService)
+ {
+ _applicationBreadService = applicationBreadService;
+ }
+
+ public override object OnDelete(DeleteApplicationRequest request)
+ {
+ _applicationBreadService.DeleteApplication(request);
+ return null;
+ }
+ }
+}
View
21 Api.RestHandlers/Handlers/DeleteApplicationServiceRequestHandler.cs
@@ -0,0 +1,21 @@
+using Api.Contracts.DTO;
+using Api.Contracts.Services;
+using ServiceStack.ServiceInterface;
+
+namespace Api.RestHandlers.Handlers
+{
+ public class DeleteApplicationServiceRequestHandler : RestServiceBase<DeleteApplicationServiceRequest>
+ {
+ private readonly IApplicationBreadService _applicationBreadService;
+
+ public DeleteApplicationServiceRequestHandler(IApplicationBreadService applicationBreadService)
+ {
+ _applicationBreadService = applicationBreadService;
+ }
+ public override object OnDelete(DeleteApplicationServiceRequest request)
+ {
+ _applicationBreadService.DeleteApplicationService(request);
+ return null;
+ }
+ }
+}
View
2  Api.RestHandlers/EmptyExampleHandler.cs → Api.RestHandlers/Handlers/EmptyExampleHandler.cs
@@ -1,7 +1,7 @@
using Api.Contracts;
using ServiceStack.ServiceInterface;
-namespace Api.RestHandlers
+namespace Api.RestHandlers.Handlers
{
public class EmptyExampleHandler: RestServiceBase<EmptyDto>
{
View
21 Api.RestHandlers/Handlers/GetApplicationRequestHandler.cs
@@ -0,0 +1,21 @@
+using Api.Contracts.DTO;
+using Api.Contracts.Services;
+using ServiceStack.ServiceInterface;
+
+namespace Api.RestHandlers.Handlers
+{
+ public class GetApplicationRequestHandler : RestServiceBase<GetApplicationRequest>
+ {
+ private readonly IApplicationBreadService _applicationBreadService;
+
+ public GetApplicationRequestHandler(IApplicationBreadService applicationBreadService)
+ {
+ _applicationBreadService = applicationBreadService;
+ }
+
+ public override object OnGet(GetApplicationRequest request)
+ {
+ return _applicationBreadService.GetApplication(request);
+ }
+ }
+}
View
2  Api.RestHandlers/GetRegistrationHtmlHandler.cs → ...stHandlers/Handlers/GetRegistrationHtmlHandler.cs
@@ -2,7 +2,7 @@
using Api.Contracts.Services;
using ServiceStack.ServiceInterface;
-namespace Api.RestHandlers
+namespace Api.RestHandlers.Handlers
{
[RequiresAppRegistration(Priority = -1, ApplyTo = ApplyTo.All)]
public class GetRegistrationHtmlHandler : RestServiceBase<GetRegistrationHtmlRequest>
View
2  ...tHandlers/GetServiceTokenForPrincipalIdHandler.cs → .../Handlers/GetServiceTokenForPrincipalIdHandler.cs
@@ -2,7 +2,7 @@
using Api.Contracts.Services;
using ServiceStack.ServiceInterface;
-namespace Api.RestHandlers
+namespace Api.RestHandlers.Handlers
{
[RequiresAppRegistration(Priority = -1, ApplyTo = ApplyTo.All)]
public class GetServiceTokenForPrincipalIdHandler : RestServiceBase<GetServiceTokenForPrincipalIdRequest>
View
3  Api.RestHandlers/GetSupportedServicesHandler.cs → ...tHandlers/Handlers/GetSupportedServicesHandler.cs
@@ -1,8 +1,9 @@
using Api.Contracts.Dto;
using Api.Contracts.Services;
+using ServiceStack.FluentValidation;
using ServiceStack.ServiceInterface;
-namespace Api.RestHandlers
+namespace Api.RestHandlers.Handlers
{
[RequiresAppRegistration(Priority = -1, ApplyTo = ApplyTo.All)]
public class GetSupportedServicesHandler : RestServiceBase<GetSupportedServicesRequest>
View
21 Api.RestHandlers/Handlers/GetUserRequestHandler.cs
@@ -0,0 +1,21 @@
+using Api.Contracts.DTO;
+using Api.Contracts.Services;
+using ServiceStack.ServiceInterface;
+
+namespace Api.RestHandlers.Handlers
+{
+ public class GetUserRequestHandler : RestServiceBase<GetUserRequest>
+ {
+ private readonly IUserBreadService _userBreadService;
+
+ public GetUserRequestHandler(IUserBreadService userBreadService)
+ {
+ _userBreadService = userBreadService;
+ }
+
+ public override object OnGet(GetUserRequest request)
+ {
+ return _userBreadService.GetUser(request);
+ }
+ }
+}
View
2  Api.RestHandlers/IsRegisteredForServiceHandler.cs → ...andlers/Handlers/IsRegisteredForServiceHandler.cs
@@ -2,7 +2,7 @@
using Api.Contracts.Services;
using ServiceStack.ServiceInterface;
-namespace Api.RestHandlers
+namespace Api.RestHandlers.Handlers
{
[RequiresAppRegistration(Priority = -1, ApplyTo = ApplyTo.All)]
public class IsRegisteredForServiceHandler : RestServiceBase<IsRegisteredForServiceRequest>
View
22 Api.RestHandlers/Handlers/RegisterAccountRequestHandler.cs
@@ -0,0 +1,22 @@
+using Api.Contracts.DTO;
+using Api.Contracts.Services;
+using ServiceStack.ServiceInterface;
+
+namespace Api.RestHandlers.Handlers
+{
+ public class RegisterAccountRequestHandler : RestServiceBase<RegisterAccountRequest>
+ {
+ private readonly IAccountRegistrationService _accountRegistrationService;
+
+ public RegisterAccountRequestHandler(IAccountRegistrationService accountRegistrationService)
+ {
+ _accountRegistrationService = accountRegistrationService;
+ }
+
+ public override object OnPost(RegisterAccountRequest request)
+ {
+ _accountRegistrationService.RegisterAccountForUser(request);
+ return null;
+ }
+ }
+}
View
20 Api.RestHandlers/Handlers/RegisterAccountUserRequestHandler.cs
@@ -0,0 +1,20 @@
+using Api.Contracts.DTO;
+using Api.Contracts.Services;
+using ServiceStack.ServiceInterface;
+
+namespace Api.RestHandlers.Handlers
+{
+ public class RegisterAccountUserRequestHandler : RestServiceBase<RegisterAccountUserRequest>
+ {
+ private readonly IUserBreadService _userBreadService;
+ public RegisterAccountUserRequestHandler(IUserBreadService userBreadService)
+ {
+ _userBreadService = userBreadService;
+ }
+
+ public override object OnPost(RegisterAccountUserRequest request)
+ {
+ return _userBreadService.RegisterUserForAccount(request);
+ }
+ }
+}
View
2  ...Handlers/RegisterServiceProviderRequestHandler.cs → ...Handlers/RegisterServiceProviderRequestHandler.cs
@@ -2,7 +2,7 @@
using Api.Contracts.Services;
using ServiceStack.ServiceInterface;
-namespace Api.RestHandlers
+namespace Api.RestHandlers.Handlers
{
[RequiresAppRegistration(Priority = -1, ApplyTo = ApplyTo.All)]
public class RegisterServiceProviderRequestHandler: RestServiceBase<RegisterServiceProviderRequest>
View
2  Api.RestHandlers/RegisterServiceTokenHandler.cs → ...tHandlers/Handlers/RegisterServiceTokenHandler.cs
@@ -2,7 +2,7 @@
using Api.Contracts.Services;
using ServiceStack.ServiceInterface;
-namespace Api.RestHandlers
+namespace Api.RestHandlers.Handlers
{
[RequiresAppRegistration(Priority = -1, ApplyTo = ApplyTo.All)]
public class RegisterServiceTokenHandler : RestServiceBase<RegisterServiceTokenRequest>
View
41 Api.RestHandlers/RequiresAppRegistrationAttribute.cs
@@ -1,6 +1,9 @@
using System;
+using System.Collections.Generic;
+using System.Linq;
using System.Net;
using Api.Contracts.Dto;
+using Api.Contracts.Repositories;
using Api.Contracts.Services;
using ServiceStack.Logging;
using ServiceStack.ServiceHost;
@@ -14,6 +17,8 @@ public class RequiresAppRegistrationAttribute: RequestFilterAttribute
private static readonly ILog Log = LogManager.GetLogger(typeof(RequiresAppRegistrationAttribute));
public IApplicationAuthenticationService ApplicationAuthenticationService { get; set; }
+ public IApplicationRepository ApplicationRepository { get; set; }
+ public IAccountApplicationRepository AccountApplicationRepository { get; set; }
public override void Execute(IHttpRequest req, IHttpResponse res, object requestDto)
{
@@ -33,7 +38,43 @@ public override void Execute(IHttpRequest req, IHttpResponse res, object request
{
applicationRequest.AppKey = appKey;
applicationRequest.AppSecret = appSecret;
+ applicationRequest.Application = ApplicationRepository.FindApplication(appKey, appSecret);
+ applicationRequest.Account = AccountApplicationRepository.GetForApplication(applicationRequest.Application.Id);
}
+ var validationErrors = ValidateRequest(applicationRequest);
+ if (validationErrors.Any())
+ {
+ res.StatusCode = (int)HttpStatusCode.BadRequest;
+ // Some Android devices require a body, otherwise the response code is ignored and set 0
+ res.Write(HttpStatusCode.BadRequest.ToString());
+ foreach (var error in validationErrors)
+ {
+ res.Write(error);
+ }
+ res.Close();
+ }
+ }
+
+ private IEnumerable<string> ValidateRequest(ApplicationRequest applicationRequest)
+ {
+ var errors = new List<string>();
+ if(string.IsNullOrEmpty(applicationRequest.AppKey))
+ {
+ errors.Add("AppKey is empty");
+ }
+ if (string.IsNullOrEmpty(applicationRequest.AppSecret))
+ {
+ errors.Add("AppSecret is empty");
+ }
+ if(applicationRequest.Account == null)
+ {
+ errors.Add("Account couldn't be found");
+ }
+ if (applicationRequest.Application == null)
+ {
+ errors.Add("Application couldn't be found");
+ }
+ return errors;
}
private string GetAppSecretFromRequest(IHttpRequest httpRequest, ApplicationRequest requestDto)
View
17 Api.RestHandlers/Validators/ApplicationRequestValidator.cs
@@ -0,0 +1,17 @@
+using Api.Contracts.Dto;
+
+namespace Api.RestHandlers.Validators
+{
+ public interface IApplicationRequestValidator
+ {
+ bool ValidApplicationRequest(ApplicationRequest request);
+ }
+
+ public class ApplicationRequestValidator: IApplicationRequestValidator
+ {
+ public bool ValidApplicationRequest(ApplicationRequest request)
+ {
+ return !string.IsNullOrEmpty(request.AppKey) && !string.IsNullOrEmpty(request.AppSecret);
+ }
+ }
+}
View
19 Api.RestHandlers/Validators/GetSupportedServicesRequestValidator.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Api.Contracts.Dto;
+using ServiceStack.FluentValidation;
+
+namespace Api.RestHandlers.Validators
+{
+ public class GetSupportedServicesRequestValidator : AbstractValidator<GetSupportedServicesRequest>
+ {
+ public IApplicationRequestValidator ApplicationRequestValidator { get; set; }
+
+ public GetSupportedServicesRequestValidator()
+ {
+ RuleFor(msg => msg).Must(x => ApplicationRequestValidator.ValidApplicationRequest(x));
+ }
+ }
+}
View
13 Api.RestServiceHost/Api.RestServiceHost.csproj
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -15,6 +16,11 @@
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>false</UseIISExpress>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <OldToolsVersion>4.0</OldToolsVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -152,8 +158,13 @@
<ItemGroup>
<Folder Include="Views\" />
</ItemGroup>
+ <PropertyGroup>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+ </PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
+ <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<!-- 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.
<Target Name="BeforeBuild">
View
5 Api.RestServiceHost/App_Start/AppHost.cs
@@ -1,5 +1,6 @@
-using Api.Implementations;
using Api.RestHandlers;
+using Api.RestHandlers.Handlers;
+using Api.RestHandlers.Validators;
using Core;
using ServiceStack.CacheAccess;
using ServiceStack.CacheAccess.Providers;
@@ -37,6 +38,8 @@ public override void Configure(Funq.Container container)
Plugins.Add(new ValidationFeature());
+ container.RegisterValidators(typeof(ApplicationRequestValidator).Assembly);
+
Plugins.Add(new RequestLogsFeature());
View
25 Core/DataConnectionProvider.cs
@@ -28,35 +28,32 @@ public IDbConnection OpenConnection()
return _dbFactory.OpenDbConnection();
}
- public void TransactionWithCommand(Action<IDbCommand> commandAction)
+ public void TransactionWithCommand(Action<IDbConnection> commandAction)
{
- using (var dbConn = _dbFactory.OpenDbConnection())
- using (var dbCmd = dbConn.CreateCommand())
- using (var trans = dbCmd.BeginTransaction())
+ using (var dbConn = _dbFactory.OpenDbConnection())
+ using (var trans = dbConn.BeginTransaction())
{
- commandAction(dbCmd);
+ commandAction(dbConn);
trans.Commit();
}
}
- public void WithCommand(Action<IDbCommand> commandAction)
+ public void WithCommand(Action<IDbConnection> commandAction)
{
using (var dbConn = _dbFactory.OpenDbConnection())
- using (var dbCmd = dbConn.CreateCommand())
{
- commandAction(dbCmd);
+ commandAction(dbConn);
}
}
- public T ExecuteQuery<T>(Func<IDbCommand, T> commandAction)
+ public T ExecuteQuery<T>(Func<IDbConnection, T> commandAction)
{
T retVal;
- using (var dbConn = _dbFactory.OpenDbConnection())
- using (var dbCmd = dbConn.CreateCommand())
+ using (var dbConn = _dbFactory.OpenDbConnection())
{
- retVal = commandAction(dbCmd);
+ retVal = commandAction(dbConn);
}
return retVal;
}
@@ -66,9 +63,9 @@ public T Single<T>(string name, string value) where T : new()
T retVal;
using (var dbConn = _dbFactory.OpenDbConnection())
- using (var dbCmd = dbConn.CreateCommand())
+ using (var dbCmd = dbConn.CreateCommand())
{
- retVal = dbCmd.SingleWhere<T>(name, value);
+ retVal = dbCmd.SingleWhere<T>(name, value);
}
return retVal;
}
View
6 Core/IDataConnectionProvider.cs
@@ -7,11 +7,11 @@ public interface IDataConnectionProvider
{
IDbConnection OpenConnection();
- void TransactionWithCommand(Action<IDbCommand> commandAction);
+ void TransactionWithCommand(Action<IDbConnection> commandAction);
- void WithCommand(Action<IDbCommand> commandAction);
+ void WithCommand(Action<IDbConnection> commandAction);
- T ExecuteQuery<T>(Func<IDbCommand, T> commandAction);
+ T ExecuteQuery<T>(Func<IDbConnection, T> commandAction);
T Single<T>(string name, string value) where T : new();
View
2  Core/ServiceRegistration.cs
@@ -30,7 +30,7 @@ public static IEnumerable<Type> GetTypes(Assembly assembly)
var t = assembly.GetTypes();
return t;
}
- catch (Exception e)
+ catch (Exception)
{
return Enumerable.Empty<Type>();
}
View
1  Data/DataItem.cs
@@ -10,6 +10,7 @@ public DataItem()
UniqueId = Guid.NewGuid();
Created = DateTime.UtcNow;
Updated = DateTime.UtcNow;
+ Status = 1;
}
[AutoIncrement]
[PrimaryKey]
View
75 Data/DataItemRepository.cs
@@ -1,40 +1,37 @@
-using System;
-using System.Collections.Generic;
-using ServiceStack.OrmLite;
-
-namespace Data
-{
- public class DataItemRepository<T> : IDataItemRepository where T : IDataItem, new()
- {
- protected OrmLiteConnectionFactory DbFactory = Registration.OrmLiteConnectionFactory();
-
- public IEnumerable<T> GetAll()
- {
- using (var dbConn = DbFactory.OpenDbConnection())
- using (var dbCmd = dbConn.CreateCommand())
- {
- return dbCmd.Select<T>();
- }
- }
-
- public IDataItem GetById(int id)
- {
- using (var dbConn = DbFactory.OpenDbConnection())
- using (var dbCmd = dbConn.CreateCommand())
- {
- return dbCmd.GetById<T>(id);
- }
- }
-
- // Todo: Add 'UpdatedBy'
- public void Add(T itemToAdd)
- {
- using (var dbConn = DbFactory.OpenDbConnection())
- using (var dbCmd = dbConn.CreateCommand())
- {
- itemToAdd.Created = itemToAdd.Updated = DateTime.Now;
- dbCmd.Insert(itemToAdd);
- }
- }
- }
+using System;
+using System.Collections.Generic;
+using ServiceStack.OrmLite;
+
+namespace Data
+{
+ public class DataItemRepository<T> : IDataItemRepository where T : IDataItem, new()
+ {
+ protected OrmLiteConnectionFactory DbFactory = Registration.OrmLiteConnectionFactory();
+
+ public IEnumerable<T> GetAll()
+ {
+ using (var dbConn = DbFactory.OpenDbConnection())
+ {
+ return dbConn.Select<T>();
+ }
+ }
+
+ public IDataItem GetById(int id)
+ {
+ using (var dbConn = DbFactory.OpenDbConnection())
+ {
+ return dbConn.GetById<T>(id);
+ }
+ }
+
+ // Todo: Add 'UpdatedBy'
+ public void Add(T itemToAdd)
+ {
+ using (var dbConn = DbFactory.OpenDbConnection())
+ {
+ itemToAdd.Created = itemToAdd.Updated = DateTime.Now;
+ dbConn.Insert(itemToAdd);
+ }
+ }
+ }
}
View
13 Demo/Demo.csproj
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -14,6 +15,11 @@
<AssemblyName>Demo</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<UseIISExpress>false</UseIISExpress>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <OldToolsVersion>4.0</OldToolsVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -70,8 +76,13 @@
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
+ <PropertyGroup>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+ </PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
+ <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
View
30 FederatedOauthConsumer.sln
@@ -1,6 +1,13 @@

-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{87B29660-B01A-4229-A4CC-C8CDC34BF124}"
+ ProjectSection(SolutionItems) = preProject
+ FederatedOauthConsumer.vsmdi = FederatedOauthConsumer.vsmdi
+ Local.testsettings = Local.testsettings
+ TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings
+ EndProjectSection
+EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core", "Core\Core.csproj", "{1F902AAD-9A34-4530-A3E3-62B0F31A38A5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Data", "Data\Data.csproj", "{B40B33E8-B802-4384-8F22-F7670B060566}"
@@ -13,23 +20,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Api.RestServiceHost", "Api.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Data.Tests", "Data.Tests\Data.Tests.csproj", "{CAFB6F8B-43B7-4EDC-A37B-5EAA8DCD7D9C}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{87B29660-B01A-4229-A4CC-C8CDC34BF124}"
- ProjectSection(SolutionItems) = preProject
- FederatedOauthConsumer.vsmdi = FederatedOauthConsumer.vsmdi
- Local.testsettings = Local.testsettings
- TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings
- EndProjectSection
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo", "Demo\Demo.csproj", "{B966A7EC-C51E-434F-814E-BD78FFCF6B62}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "yammerservice", "YammerService\yammerservice.csproj", "{DB45A4A0-3102-4AEC-B4DA-E564976A8D94}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Api.RestHandlers", "Api.RestHandlers\Api.RestHandlers.csproj", "{3FCFB5FC-6C1B-4F21-9862-CFA2583C5020}"
EndProject
Global
- GlobalSection(TestCaseManagementSettings) = postSolution
- CategoryFile = FederatedOauthConsumer.vsmdi
- EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
@@ -63,10 +58,6 @@ Global
{B966A7EC-C51E-434F-814E-BD78FFCF6B62}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B966A7EC-C51E-434F-814E-BD78FFCF6B62}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B966A7EC-C51E-434F-814E-BD78FFCF6B62}.Release|Any CPU.Build.0 = Release|Any CPU
- {DB45A4A0-3102-4AEC-B4DA-E564976A8D94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DB45A4A0-3102-4AEC-B4DA-E564976A8D94}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DB45A4A0-3102-4AEC-B4DA-E564976A8D94}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DB45A4A0-3102-4AEC-B4DA-E564976A8D94}.Release|Any CPU.Build.0 = Release|Any CPU
{3FCFB5FC-6C1B-4F21-9862-CFA2583C5020}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3FCFB5FC-6C1B-4F21-9862-CFA2583C5020}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3FCFB5FC-6C1B-4F21-9862-CFA2583C5020}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -75,4 +66,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
+ GlobalSection(TestCaseManagementSettings) = postSolution
+ CategoryFile = FederatedOauthConsumer.vsmdi
+ EndGlobalSection
EndGlobal
View
BIN  UpgradeLog.htm
Binary file not shown
View
13 YammerService/yammerservice.csproj
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -15,6 +16,11 @@
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>false</UseIISExpress>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <OldToolsVersion>4.0</OldToolsVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -147,8 +153,13 @@
<ItemGroup>
<Folder Include="Views\" />
</ItemGroup>
+ <PropertyGroup>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+ </PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
+ <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<!-- 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.
<Target Name="BeforeBuild">
View
BIN  _TeamCity.FederatedOauthConsumer/AssemblyInfoCache.dat
Binary file not shown
View
BIN  _TeamCity.FederatedOauthConsumer/ProjectFileDataCache/ShouldUseHostCompilerProvider.cache.dat
Binary file not shown
View
BIN  _TeamCity.FederatedOauthConsumer/ProjectModel/projectModel.dat
Binary file not shown

No commit comments for this range

Something went wrong with that request. Please try again.