Skip to content

Commit e151c28

Browse files
authored
Merge pull request #4 from hpcsc/master
Migrate executable projects to netcoreapp2.0
2 parents db49121 + 31d53e6 commit e151c28

File tree

8 files changed

+33
-77
lines changed

8 files changed

+33
-77
lines changed

Boc.Domain/Boc.Domain.fsproj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard1.6</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<Compile Include="Lib.fs" />
9+
</ItemGroup>
10+
11+
</Project>

Boc.Domain/Boc.Domain.xproj

Lines changed: 0 additions & 19 deletions
This file was deleted.

Boc.Domain/project.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

Examples/Examples.csproj

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp1.1</TargetFramework>
4+
<TargetFramework>netcoreapp2.0</TargetFramework>
55
<StartupObject>Examples.Program</StartupObject>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
10-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.1" />
11-
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.1.1" />
12-
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.1" />
13-
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.1" />
14-
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.1" />
15-
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="1.1.1" />
16-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.1" />
17-
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.1" />
18-
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
19-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
20-
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.1.1" />
9+
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.3" />
2110

2211
<PackageReference Include="Dapper" Version="1.50.2" />
23-
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
24-
<PackageReference Include="StackExchange.Redis" Version="1.1.608" />
12+
<PackageReference Include="Newtonsoft.Json" Version="10.0.1" />
2513
<PackageReference Include="Swashbuckle" Version="6.0.0-beta902" />
2614
<PackageReference Include="System.Collections.Specialized" Version="4.3.0" />
2715
<PackageReference Include="System.Data.Common" Version="4.3.0" />
28-
<PackageReference Include="System.Data.SqlClient" Version="4.3.0" />
16+
<PackageReference Include="System.Data.SqlClient" Version="4.4.0" />
2917
<PackageReference Include="System.Reactive" Version="3.1.1" />
3018
<PackageReference Include="System.Reactive.Core" Version="3.1.1" />
3119

@@ -39,4 +27,4 @@
3927
<ProjectReference Include="..\LaYumba.Functional\LaYumba.Functional.csproj" />
4028
</ItemGroup>
4129

42-
</Project>
30+
</Project>

Examples/Program.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using LaYumba.Functional;
88

99
using System.Reflection;
10+
using Microsoft.AspNetCore;
1011

1112
namespace Examples
1213
{
@@ -39,11 +40,8 @@ public static void Main(string[] args)
3940
}
4041

4142
static void StartWebApi()
42-
{
43-
var host = new WebHostBuilder()
44-
.UseKestrel()
45-
.UseContentRoot(Directory.GetCurrentDirectory())
46-
.UseIISIntegration()
43+
{
44+
var host = WebHost.CreateDefaultBuilder()
4745
.UseStartup<Boc.Startup>()
4846
.Build();
4947

Exercises/Exercises.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp1.1</TargetFramework>
5+
<TargetFramework>netcoreapp2.0</TargetFramework>
66
<StartupObject>Exercises.Program</StartupObject>
77
</PropertyGroup>
88

@@ -18,4 +18,4 @@
1818
<ProjectReference Include="..\LaYumba.Functional\LaYumba.Functional.csproj" />
1919
</ItemGroup>
2020

21-
</Project>
21+
</Project>

LaYumba.Functional.Tests/LaYumba.Functional.Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp1.1</TargetFramework>
4+
<TargetFramework>netcoreapp2.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
@@ -11,7 +11,7 @@
1111

1212
<PackageReference Include="FsCheck" Version="3.0.0-alpha-b752" />
1313
<PackageReference Include="FsCheck.Xunit" Version="3.0.0-alpha-b752" />
14-
14+
1515
<PackageReference Include="xunit" Version="2.2.0" />
1616
<PackageReference Include="xunit.runner.console" Version="2.2.0" />
1717
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
@@ -24,4 +24,4 @@
2424
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
2525
</ItemGroup>
2626

27-
</Project>
27+
</Project>

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,26 @@ The code samples are organized in the following projects:
1212
- **Exercises**: placeholders for you to do the exercises, compile and run them;
1313
and compare to the provided solutions
1414
- **LaYumba.Functional**: a functional library that we develop throughout the book
15-
- **LaYumba.Functional.Data**: very simple functional data structures discussed in Chapter 9
15+
- **LaYumba.Functional.Data**: very simple functional data structures discussed in Chapter 9
1616
- **LaYumba.Functional.Tests**: also illustrative of topics explained in the book, and
1717
useful to better understand the constructs in the library
1818
- **Boc.Domain**: an example of using F# for domain objects
1919

20-
**Note:** you are welcome to reference `LaYumba.Functional` from your projects
20+
**Note:** you are welcome to reference `LaYumba.Functional` from your projects
2121
via [NuGet](https://www.nuget.org/packages/LaYumba.Functional), and submit
22-
PRs with improvements, but the main intent of this library is pedagogical.
22+
PRs with improvements, but the main intent of this library is pedagogical.
2323
For a more fully-fledged functional library, consider [LanguageExt](https://github.com/louthy/language-ext)
2424

2525
## Working with the code samples
2626

27-
The code samples use .NET Standard 1.6 and .NET Core 1.1, and should compile and run on all major OS's
27+
The code samples use .NET Standard 1.6 and .NET Core 2.0, and should compile and run on all major OS's
2828
via the `dotnet` CLI.
2929

3030
### Prerequisites
3131

32-
- [.NET Core 1.1.1 SDK](https://www.microsoft.com/net/download/core)
32+
- [.NET Core 2.0.3 SDK](https://www.microsoft.com/net/download/core)
3333

34-
To check this is available, type `dotnet --version` at the command prompt, and you should get `1.0.1` or greater
34+
To check this is available, type `dotnet --version` at the command prompt, and you should get `2.0.3` or greater
3535

3636
### One-time setup
3737

@@ -62,7 +62,7 @@ $ cd Examples
6262
$ dotnet run Greetings
6363
```
6464

65-
| Section | Command
65+
| Section | Command
6666
|---:| ---
6767
| 7.1 | `dotnet run Greetings`
6868

@@ -75,14 +75,14 @@ Throughout the book, I encourage readers to try things out in the [REPL](https:/
7575
- On Mono, use the `csharp` command
7676
- There are several other REPLs available, some even run in the browser
7777

78-
You'll often need to import `LaYumba.Functional` in the REPL. In C# Interactive,
78+
You'll often need to import `LaYumba.Functional` in the REPL. In C# Interactive,
7979
this can be done like so:
8080

8181
```csharp
8282
#r "functional-csharp-code\LaYumba.Functional\bin\Debug\netstandard1.6\LaYumba.Functional.dll"
8383
```
8484

85-
The path above may not work for you, in which case use an absolute path to the dll,
85+
The path above may not work for you, in which case use an absolute path to the dll,
8686
or type `Directory.GetCurrentDirectory()` into the REPL to see what to use as a base for a relative path.
8787

8888
Next, add these imports:

0 commit comments

Comments
 (0)