Skip to content

Commit

Permalink
Rest+DataService
Browse files Browse the repository at this point in the history
  • Loading branch information
zlphoenix committed Jan 13, 2016
1 parent 0fcd146 commit 8639ed3
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 3 deletions.
29 changes: 27 additions & 2 deletions CSharpFeatures/PL/EFDemo/App.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>

Expand All @@ -14,4 +14,29 @@
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /></startup><system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="EFDemo.Class1">
<endpoint address="" binding="basicHttpBinding" contract="EFDemo.IClass1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8733/Design_Time_Addresses/EFDemo/Class1/" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>
17 changes: 17 additions & 0 deletions CSharpFeatures/PL/EFDemo/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace EFDemo
{
// NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Class1" in both code and config file together.
public class Class1 : IClass1
{
public void DoWork()
{
}
}
}
5 changes: 5 additions & 0 deletions CSharpFeatures/PL/EFDemo/EFDemo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<WcfConfigValidationEnabled>True</WcfConfigValidationEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -42,13 +43,17 @@
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<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="Class1.cs" />
<Compile Include="IClass1.cs" />
<Compile Include="Migrations\201512281750409_ADDAge.cs" />
<Compile Include="Migrations\201512281750409_ADDAge.Designer.cs">
<DependentUpon>201512281750409_ADDAge.cs</DependentUpon>
Expand Down
17 changes: 17 additions & 0 deletions CSharpFeatures/PL/EFDemo/IClass1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace EFDemo
{
// NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IClass1" in both code and config file together.
[ServiceContract]
public interface IClass1
{
[OperationContract]
void DoWork();
}
}
2 changes: 1 addition & 1 deletion CSharpFeatures/Svc/WebApiSelfHosting/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static void Main()
client.DefaultRequestHeaders
.Accept
.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
//client.DefaultRequestHeaders.Add("Content-Type", "application/json");
HttpResponseMessage response = client.GetAsync(baseAddress + "api/values").Result;

Console.WriteLine(response);
Expand Down
45 changes: 45 additions & 0 deletions CSharpFeatures/Svc/WebApiSelfHosting/WebApiSelfHosting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>R:\Publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -32,6 +48,22 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>7C4E41BB8AE5F33FB364E80F3D5AA6545B3B5BB4</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>
</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>false</SignManifests>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Owin, Version=2.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.2.0.2\lib\net45\Microsoft.Owin.dll</HintPath>
Expand Down Expand Up @@ -83,6 +115,19 @@
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
<None Include="WebApiSelfHosting_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5.2 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
Binary file not shown.

0 comments on commit 8639ed3

Please sign in to comment.