Skip to content

Commit ba004eb

Browse files
Ensure all files have consistent line-endings.
1 parent c466c24 commit ba004eb

31 files changed

+346
-346
lines changed
Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
parameters:
2-
- name: project
3-
type: string
4-
default: # Empty
5-
- name: configuration
6-
type: string
7-
default: # Empty
8-
- name: packageVersion
9-
type: string
10-
default: # Empty
11-
- name: outputDir
12-
type: string
13-
default: # Empty
14-
15-
16-
steps:
17-
- template: check.missing.parameters.yml
18-
19-
- task: DotNetCoreCLI@2
20-
displayName: Package ${{ parameters.project }}
21-
inputs:
22-
command: custom # such convenience, much easy
23-
custom: pack
24-
arguments: ${{ parameters.project }} --verbosity Detailed --configuration ${{ parameters.configuration }} --output ${{ parameters.outputDir }} --no-build --no-restore --include-source --include-symbols -p:SymbolPackageFormat=snupkg -p:PackageVersion=${{ parameters.packageVersion }}
25-
nobuild: true # ... None ...
26-
includesource: true # ... of ...
27-
includesymbols: true # ... these ...
28-
outputDir: ${{ parameters.outputDir }} # ... do ...
29-
packagesToPack: ${{ parameters.project }} # ... anything. ...
1+
parameters:
2+
- name: project
3+
type: string
4+
default: # Empty
5+
- name: configuration
6+
type: string
7+
default: # Empty
8+
- name: packageVersion
9+
type: string
10+
default: # Empty
11+
- name: outputDir
12+
type: string
13+
default: # Empty
14+
15+
16+
steps:
17+
- template: check.missing.parameters.yml
18+
19+
- task: DotNetCoreCLI@2
20+
displayName: Package ${{ parameters.project }}
21+
inputs:
22+
command: custom # such convenience, much easy
23+
custom: pack
24+
arguments: ${{ parameters.project }} --verbosity Detailed --configuration ${{ parameters.configuration }} --output ${{ parameters.outputDir }} --no-build --no-restore --include-source --include-symbols -p:SymbolPackageFormat=snupkg -p:PackageVersion=${{ parameters.packageVersion }}
25+
nobuild: true # ... None ...
26+
includesource: true # ... of ...
27+
includesymbols: true # ... these ...
28+
outputDir: ${{ parameters.outputDir }} # ... do ...
29+
packagesToPack: ${{ parameters.project }} # ... anything. ...
Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
1-
# Modelled after https://github.com/UiPath/ServiceCommon/blob/3f7b73831b9ac4106ad89e036c955220f96f5eb3/Ledger/.vsts-ci.yml
2-
3-
parameters:
4-
- name: environment
5-
type: string
6-
default: # Empty, to force people to think about this
7-
- name: feed
8-
type: string
9-
default: # Empty, to force people to think about this
10-
- name: version
11-
type: string
12-
default: # Empty, to force people to think about this
13-
- name: condition
14-
type: string
15-
default: # Empty, to force people to think about this
16-
- name: dependsOn
17-
type: object
18-
default: # Empty, to force people to think about this
19-
20-
21-
stages:
22-
- stage: PublishTo${{ replace(parameters.environment, '-', '') }}
23-
displayName: Publish packages to ${{ parameters.environment }} feed
24-
dependsOn:
25-
${{ parameters.dependsOn }}
26-
condition: and(succeeded(), ${{ parameters.condition }})
27-
jobs:
28-
- deployment:
29-
environment: ${{ parameters.environment }}
30-
workspace:
31-
clean: all
32-
strategy:
33-
runOnce:
34-
deploy:
35-
steps:
36-
- checkout: none
37-
38-
- template: check.missing.parameters.yml
39-
40-
- task: Bash@3
41-
displayName: Set version number environment variable
42-
inputs:
43-
targetType: 'inline'
44-
script: |
45-
echo "setting version to '${{ parameters.version }}'"
46-
echo "##vso[task.setvariable variable=NuGetVerionEnvVar]${{ parameters.version }}"
47-
48-
- task: NuGetCommand@2
49-
inputs:
50-
command: push
51-
versioningScheme: byEnvVar
52-
versionEnvVar: NuGetVerionEnvVar
53-
packagesToPush: $(Pipeline.Workspace)/**/*.nupkg
54-
publishVstsFeed: ${{ parameters.feed }}
1+
# Modelled after https://github.com/UiPath/ServiceCommon/blob/3f7b73831b9ac4106ad89e036c955220f96f5eb3/Ledger/.vsts-ci.yml
2+
3+
parameters:
4+
- name: environment
5+
type: string
6+
default: # Empty, to force people to think about this
7+
- name: feed
8+
type: string
9+
default: # Empty, to force people to think about this
10+
- name: version
11+
type: string
12+
default: # Empty, to force people to think about this
13+
- name: condition
14+
type: string
15+
default: # Empty, to force people to think about this
16+
- name: dependsOn
17+
type: object
18+
default: # Empty, to force people to think about this
19+
20+
21+
stages:
22+
- stage: PublishTo${{ replace(parameters.environment, '-', '') }}
23+
displayName: Publish packages to ${{ parameters.environment }} feed
24+
dependsOn:
25+
${{ parameters.dependsOn }}
26+
condition: and(succeeded(), ${{ parameters.condition }})
27+
jobs:
28+
- deployment:
29+
environment: ${{ parameters.environment }}
30+
workspace:
31+
clean: all
32+
strategy:
33+
runOnce:
34+
deploy:
35+
steps:
36+
- checkout: none
37+
38+
- template: check.missing.parameters.yml
39+
40+
- task: Bash@3
41+
displayName: Set version number environment variable
42+
inputs:
43+
targetType: 'inline'
44+
script: |
45+
echo "setting version to '${{ parameters.version }}'"
46+
echo "##vso[task.setvariable variable=NuGetVerionEnvVar]${{ parameters.version }}"
47+
48+
- task: NuGetCommand@2
49+
inputs:
50+
command: push
51+
versioningScheme: byEnvVar
52+
versionEnvVar: NuGetVerionEnvVar
53+
packagesToPush: $(Pipeline.Workspace)/**/*.nupkg
54+
publishVstsFeed: ${{ parameters.feed }}

Program/Program.cs

Lines changed: 114 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,114 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using SqlKata;
4-
using SqlKata.Compilers;
5-
using SqlKata.Execution;
6-
using System.Data.SqlClient;
7-
using System.Threading.Tasks;
8-
using System.Linq;
9-
using Newtonsoft.Json;
10-
using Npgsql;
11-
using System.Data;
12-
using Dapper;
13-
using System.Data.SQLite;
14-
using static SqlKata.Expressions;
15-
using System.IO;
16-
17-
namespace Program
18-
{
19-
class Program
20-
{
21-
private class Loan
22-
{
23-
public string Id { get; set; }
24-
public string Name { get; set; }
25-
public List<Installment> Installments { get; set; } = new List<Installment>();
26-
}
27-
28-
private class Installment
29-
{
30-
public string Id { get; set; }
31-
public string LoanId { get; set; }
32-
public int DaysCount { get; set; }
33-
}
34-
35-
static void Main(string[] args)
36-
{
37-
using (var db = SqlLiteQueryFactory())
38-
{
39-
var query = db.Query("accounts")
40-
.Where("balance", ">", 0)
41-
.GroupBy("balance")
42-
.Limit(10);
43-
44-
var accounts = query.Clone().Get();
45-
Console.WriteLine(JsonConvert.SerializeObject(accounts, Formatting.Indented));
46-
47-
var exists = query.Clone().Exists();
48-
Console.WriteLine(exists);
49-
}
50-
}
51-
52-
private static void log(Compiler compiler, Query query)
53-
{
54-
var compiled = compiler.Compile(query);
55-
Console.WriteLine(compiled.ToString());
56-
Console.WriteLine(JsonConvert.SerializeObject(compiled.Bindings));
57-
}
58-
59-
private static QueryFactory SqlLiteQueryFactory()
60-
{
61-
var compiler = new SqliteCompiler();
62-
63-
var connection = new SQLiteConnection("Data Source=Demo.db");
64-
65-
var db = new QueryFactory(connection, compiler);
66-
67-
db.Logger = result =>
68-
{
69-
Console.WriteLine(result.ToString());
70-
};
71-
72-
if (!File.Exists("Demo.db"))
73-
{
74-
Console.WriteLine("db not exists creating db");
75-
76-
SQLiteConnection.CreateFile("Demo.db");
77-
78-
db.Statement("create table accounts(id integer primary key autoincrement, name varchar, currency_id varchar, balance decimal, created_at datetime);");
79-
for (var i = 0; i < 10; i++)
80-
{
81-
db.Statement("insert into accounts(name, currency_id, balance, created_at) values(@name, @currency, @balance, @date)", new
82-
{
83-
name = $"Account {i}",
84-
currency = "USD",
85-
balance = 100 * i * 1.1,
86-
date = DateTime.UtcNow,
87-
});
88-
}
89-
90-
}
91-
92-
return db;
93-
94-
}
95-
96-
private static QueryFactory SqlServerQueryFactory()
97-
{
98-
var compiler = new PostgresCompiler();
99-
var connection = new SqlConnection(
100-
"Server=tcp:localhost,1433;Initial Catalog=Lite;User ID=sa;Password=P@ssw0rd"
101-
);
102-
103-
var db = new QueryFactory(connection, compiler);
104-
105-
db.Logger = result =>
106-
{
107-
Console.WriteLine(result.ToString());
108-
};
109-
110-
return db;
111-
}
112-
113-
}
114-
}
1+
using System;
2+
using System.Collections.Generic;
3+
using SqlKata;
4+
using SqlKata.Compilers;
5+
using SqlKata.Execution;
6+
using System.Data.SqlClient;
7+
using System.Threading.Tasks;
8+
using System.Linq;
9+
using Newtonsoft.Json;
10+
using Npgsql;
11+
using System.Data;
12+
using Dapper;
13+
using System.Data.SQLite;
14+
using static SqlKata.Expressions;
15+
using System.IO;
16+
17+
namespace Program
18+
{
19+
class Program
20+
{
21+
private class Loan
22+
{
23+
public string Id { get; set; }
24+
public string Name { get; set; }
25+
public List<Installment> Installments { get; set; } = new List<Installment>();
26+
}
27+
28+
private class Installment
29+
{
30+
public string Id { get; set; }
31+
public string LoanId { get; set; }
32+
public int DaysCount { get; set; }
33+
}
34+
35+
static void Main(string[] args)
36+
{
37+
using (var db = SqlLiteQueryFactory())
38+
{
39+
var query = db.Query("accounts")
40+
.Where("balance", ">", 0)
41+
.GroupBy("balance")
42+
.Limit(10);
43+
44+
var accounts = query.Clone().Get();
45+
Console.WriteLine(JsonConvert.SerializeObject(accounts, Formatting.Indented));
46+
47+
var exists = query.Clone().Exists();
48+
Console.WriteLine(exists);
49+
}
50+
}
51+
52+
private static void log(Compiler compiler, Query query)
53+
{
54+
var compiled = compiler.Compile(query);
55+
Console.WriteLine(compiled.ToString());
56+
Console.WriteLine(JsonConvert.SerializeObject(compiled.Bindings));
57+
}
58+
59+
private static QueryFactory SqlLiteQueryFactory()
60+
{
61+
var compiler = new SqliteCompiler();
62+
63+
var connection = new SQLiteConnection("Data Source=Demo.db");
64+
65+
var db = new QueryFactory(connection, compiler);
66+
67+
db.Logger = result =>
68+
{
69+
Console.WriteLine(result.ToString());
70+
};
71+
72+
if (!File.Exists("Demo.db"))
73+
{
74+
Console.WriteLine("db not exists creating db");
75+
76+
SQLiteConnection.CreateFile("Demo.db");
77+
78+
db.Statement("create table accounts(id integer primary key autoincrement, name varchar, currency_id varchar, balance decimal, created_at datetime);");
79+
for (var i = 0; i < 10; i++)
80+
{
81+
db.Statement("insert into accounts(name, currency_id, balance, created_at) values(@name, @currency, @balance, @date)", new
82+
{
83+
name = $"Account {i}",
84+
currency = "USD",
85+
balance = 100 * i * 1.1,
86+
date = DateTime.UtcNow,
87+
});
88+
}
89+
90+
}
91+
92+
return db;
93+
94+
}
95+
96+
private static QueryFactory SqlServerQueryFactory()
97+
{
98+
var compiler = new PostgresCompiler();
99+
var connection = new SqlConnection(
100+
"Server=tcp:localhost,1433;Initial Catalog=Lite;User ID=sa;Password=P@ssw0rd"
101+
);
102+
103+
var db = new QueryFactory(connection, compiler);
104+
105+
db.Logger = result =>
106+
{
107+
Console.WriteLine(result.ToString());
108+
};
109+
110+
return db;
111+
}
112+
113+
}
114+
}

0 commit comments

Comments
 (0)