Skip to content

Commit 44101f5

Browse files
author
Tomáš Bezouška
committed
Retarget Dinosaurs sample to .net core 3, vb.net sample
1 parent 411d056 commit 44101f5

11 files changed

+168
-135
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Public Class Dinosaur
2+
Property Height() As Double
3+
End Class
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<RootNamespace>Dinosaurs.VisualBasic</RootNamespace>
6+
<TargetFramework>netcoreapp3.0</TargetFramework>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="FirebaseDatabase.net" Version="4.0.1" />
11+
</ItemGroup>
12+
13+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Imports Firebase.Database
2+
Imports Firebase.Database.Query
3+
4+
Module Program
5+
Sub Main(args As String())
6+
Run().Wait()
7+
End Sub
8+
9+
Async Function Run() As Task
10+
11+
' Since the dinosaur-facts repo no longer works, populate your own one with sample data
12+
' in "sample.json"
13+
Dim client = New FirebaseClient("https://dinosaur-facts.firebaseio.com/")
14+
15+
Dim dinos = Await client _
16+
.Child("dinosaurs") _
17+
.OrderByKey() _
18+
.StartAt("pterodactyl") _
19+
.LimitToFirst(2) _
20+
.OnceAsync(Of Dinosaur)
21+
22+
For Each dino In dinos
23+
Console.WriteLine($"{dino.Key} is {dino.Object.Height}m high.")
24+
Next
25+
26+
End Function
27+
End Module
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"dinosaurs": {
3+
"bruhathkayosaurus": {
4+
"appeared": -70000000,
5+
"height": 25,
6+
"length": 44,
7+
"order": "saurischia",
8+
"vanished": -70000000,
9+
"weight": 135000
10+
},
11+
"lambeosaurus": {
12+
"appeared": -76000000,
13+
"height": 2.1,
14+
"length": 12.5,
15+
"order": "ornithischia",
16+
"vanished": -75000000,
17+
"weight": 5000
18+
},
19+
"linhenykus": {
20+
"appeared": -85000000,
21+
"height": 0.6,
22+
"length": 1,
23+
"order": "theropoda",
24+
"vanished": -75000000,
25+
"weight": 3
26+
},
27+
"pterodactyl": {
28+
"appeared": -150000000,
29+
"height": 0.6,
30+
"length": 0.8,
31+
"order": "pterosauria",
32+
"vanished": -148500000,
33+
"weight": 2
34+
},
35+
"stegosaurus": {
36+
"appeared": -155000000,
37+
"height": 4,
38+
"length": 9,
39+
"order": "ornithischia",
40+
"vanished": -150000000,
41+
"weight": 2500
42+
},
43+
"triceratops": {
44+
"appeared": -68000000,
45+
"height": 3,
46+
"length": 8,
47+
"order": "ornithischia",
48+
"vanished": -66000000,
49+
"weight": 11000
50+
}
51+
}
52+
}

samples/Dinosaurs/Dinosaurs/App.config

-6
This file was deleted.
+8-80
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,13 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
43
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{6BD03260-DBB5-4660-8884-41BE3B1DBE1D}</ProjectGuid>
84
<OutputType>Exe</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>Firebase.Dinosaurs</RootNamespace>
11-
<AssemblyName>Firebase.Dinosaurs</AssemblyName>
12-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
5+
<RootNamespace>Dinosaurs</RootNamespace>
6+
<TargetFramework>netcoreapp3.0</TargetFramework>
147
</PropertyGroup>
15-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16-
<PlatformTarget>AnyCPU</PlatformTarget>
17-
<DebugSymbols>true</DebugSymbols>
18-
<DebugType>full</DebugType>
19-
<Optimize>false</Optimize>
20-
<OutputPath>bin\Debug\</OutputPath>
21-
<DefineConstants>DEBUG;TRACE</DefineConstants>
22-
<ErrorReport>prompt</ErrorReport>
23-
<WarningLevel>4</WarningLevel>
24-
</PropertyGroup>
25-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26-
<PlatformTarget>AnyCPU</PlatformTarget>
27-
<DebugType>pdbonly</DebugType>
28-
<Optimize>true</Optimize>
29-
<OutputPath>bin\Release\</OutputPath>
30-
<DefineConstants>TRACE</DefineConstants>
31-
<ErrorReport>prompt</ErrorReport>
32-
<WarningLevel>4</WarningLevel>
33-
</PropertyGroup>
34-
<ItemGroup>
35-
<Reference Include="Firebase.Database, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
36-
<HintPath>..\packages\FirebaseDatabase.net.2.0.1\lib\portable45-net45+win8+wpa81\Firebase.Database.dll</HintPath>
37-
<Private>True</Private>
38-
</Reference>
39-
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
40-
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
41-
<Private>True</Private>
42-
</Reference>
43-
<Reference Include="System" />
44-
<Reference Include="System.Core" />
45-
<Reference Include="System.Reactive.Core, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
46-
<HintPath>..\packages\Rx-Core.2.2.5\lib\net45\System.Reactive.Core.dll</HintPath>
47-
<Private>True</Private>
48-
</Reference>
49-
<Reference Include="System.Reactive.Interfaces, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
50-
<HintPath>..\packages\Rx-Interfaces.2.2.5\lib\net45\System.Reactive.Interfaces.dll</HintPath>
51-
<Private>True</Private>
52-
</Reference>
53-
<Reference Include="System.Reactive.Linq, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
54-
<HintPath>..\packages\Rx-Linq.2.2.5\lib\net45\System.Reactive.Linq.dll</HintPath>
55-
<Private>True</Private>
56-
</Reference>
57-
<Reference Include="System.Reactive.PlatformServices, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
58-
<HintPath>..\packages\Rx-PlatformServices.2.2.5\lib\net45\System.Reactive.PlatformServices.dll</HintPath>
59-
<Private>True</Private>
60-
</Reference>
61-
<Reference Include="System.Xml.Linq" />
62-
<Reference Include="System.Data.DataSetExtensions" />
63-
<Reference Include="Microsoft.CSharp" />
64-
<Reference Include="System.Data" />
65-
<Reference Include="System.Net.Http" />
66-
<Reference Include="System.Xml" />
67-
</ItemGroup>
68-
<ItemGroup>
69-
<Compile Include="Dinosaur.cs" />
70-
<Compile Include="Program.cs" />
71-
<Compile Include="Properties\AssemblyInfo.cs" />
72-
</ItemGroup>
8+
739
<ItemGroup>
74-
<None Include="App.config" />
75-
<None Include="packages.config" />
10+
<PackageReference Include="FirebaseDatabase.net" Version="4.0.1" />
7611
</ItemGroup>
77-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
78-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
79-
Other similar extension points exist, see Microsoft.Common.targets.
80-
<Target Name="BeforeBuild">
81-
</Target>
82-
<Target Name="AfterBuild">
83-
</Target>
84-
-->
85-
</Project>
12+
13+
</Project>

samples/Dinosaurs/Dinosaurs/Program.cs

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ public static void Main(string[] args)
1515

1616
private async Task Run()
1717
{
18+
// Since the dinosaur-facts repo no longer works, populate your own one with sample data
19+
// in "sample.json"
1820
var firebase = new FirebaseClient("https://dinosaur-facts.firebaseio.com/");
1921

2022
var dinos = await firebase

samples/Dinosaurs/Dinosaurs/Properties/AssemblyInfo.cs

-36
This file was deleted.

samples/Dinosaurs/Dinosaurs/packages.config

-10
This file was deleted.
+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"dinosaurs": {
3+
"bruhathkayosaurus": {
4+
"appeared": -70000000,
5+
"height": 25,
6+
"length": 44,
7+
"order": "saurischia",
8+
"vanished": -70000000,
9+
"weight": 135000
10+
},
11+
"lambeosaurus": {
12+
"appeared": -76000000,
13+
"height": 2.1,
14+
"length": 12.5,
15+
"order": "ornithischia",
16+
"vanished": -75000000,
17+
"weight": 5000
18+
},
19+
"linhenykus": {
20+
"appeared": -85000000,
21+
"height": 0.6,
22+
"length": 1,
23+
"order": "theropoda",
24+
"vanished": -75000000,
25+
"weight": 3
26+
},
27+
"pterodactyl": {
28+
"appeared": -150000000,
29+
"height": 0.6,
30+
"length": 0.8,
31+
"order": "pterosauria",
32+
"vanished": -148500000,
33+
"weight": 2
34+
},
35+
"stegosaurus": {
36+
"appeared": -155000000,
37+
"height": 4,
38+
"length": 9,
39+
"order": "ornithischia",
40+
"vanished": -150000000,
41+
"weight": 2500
42+
},
43+
"triceratops": {
44+
"appeared": -68000000,
45+
"height": 3,
46+
"length": 8,
47+
"order": "ornithischia",
48+
"vanished": -66000000,
49+
"weight": 11000
50+
}
51+
}
52+
}
+11-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
21
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25123.0
2+
# Visual Studio Version 16
3+
VisualStudioVersion = 16.0.29324.140
54
MinimumVisualStudioVersion = 10.0.40219.1
65
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dinosaurs", "Dinosaurs\Dinosaurs.csproj", "{6BD03260-DBB5-4660-8884-41BE3B1DBE1D}"
76
EndProject
7+
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Dinosaurs.VisualBasic", "Dinosaurs.VisualBasic\Dinosaurs.VisualBasic.vbproj", "{AFC9B7E6-FB9D-44DF-991E-1B9901ED54A5}"
8+
EndProject
89
Global
910
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1011
Debug|Any CPU = Debug|Any CPU
@@ -15,8 +16,15 @@ Global
1516
{6BD03260-DBB5-4660-8884-41BE3B1DBE1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
1617
{6BD03260-DBB5-4660-8884-41BE3B1DBE1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
1718
{6BD03260-DBB5-4660-8884-41BE3B1DBE1D}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{AFC9B7E6-FB9D-44DF-991E-1B9901ED54A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20+
{AFC9B7E6-FB9D-44DF-991E-1B9901ED54A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
21+
{AFC9B7E6-FB9D-44DF-991E-1B9901ED54A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
22+
{AFC9B7E6-FB9D-44DF-991E-1B9901ED54A5}.Release|Any CPU.Build.0 = Release|Any CPU
1823
EndGlobalSection
1924
GlobalSection(SolutionProperties) = preSolution
2025
HideSolutionNode = FALSE
2126
EndGlobalSection
27+
GlobalSection(ExtensibilityGlobals) = postSolution
28+
SolutionGuid = {B540CD96-CB08-4584-B075-84C84AFF61B4}
29+
EndGlobalSection
2230
EndGlobal

0 commit comments

Comments
 (0)