Skip to content

Commit

Permalink
Merge pull request #1 from CHG-MERIDIAN/feature/FirstImplementation
Browse files Browse the repository at this point in the history
Feature/first implementation
  • Loading branch information
twenzel authored Oct 6, 2023
2 parents 2c7bcc3 + 6a13ebf commit b11ec33
Show file tree
Hide file tree
Showing 40 changed files with 1,413 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"cake.tool": {
"version": "3.1.0",
"commands": [
"dotnet-cake"
]
}
}
}
257 changes: 257 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
# We use the config of the .NET Foundation from
# https://github.com/dotnet/roslyn/blob/master/.editorconfig
# see the doc at: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
# and a ref with examples at: http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers

# Exceptions to the .NET Foundation team rules:
# - we use Tabs instead of Spaces because we don't do cross platform development


# top-most EditorConfig file
root = true

# Use tabs for indentation.
[*]
indent_style = tab
# (Please don't specify an indent_size here; that has too many unintended consequences.)
end_of_line = crlf

# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4
trim_trailing_whitespace = true
charset=utf8

# Xml project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2

# Xml config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_size = 2

# JSON files
[*.json]
indent_size = 2

# CAKE files
[*.cake]
indent_size = 2

# Dotnet code style settings:
[*.{cs,vb}]
# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true

# Avoid "this." and "Me." if not necessary
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion

# Suggest more modern language features when available
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion

# CSharp code style settings:
[*.cs]

# Prefer "var" everywhere
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion

# Use language keywords instead of framework type names for type references
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion

# Prefer method-like constructs to have a block body
csharp_style_expression_bodied_methods = false:none
csharp_style_expression_bodied_constructors = false:none
csharp_style_expression_bodied_operators = false:none

# Prefer property-like constructs to have an expression-body
csharp_style_expression_bodied_properties = true:none
csharp_style_expression_bodied_indexers = true:none
csharp_style_expression_bodied_accessors = true:none

# Suggest more modern language features when available
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion

# Newline settings
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true

# Indents and spacing
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
#csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = do_not_ignore
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = none
csharp_space_between_square_brackets = false
csharp_preserve_single_line_statements = false
#csharp_prefer_braces = true:suggestion


[*.{cs,vb}]
# Based on https://github.com/RehanSaeed/EditorConfig/blob/master/.editorconfig
# Non-Rules see Ticket 86905
################################################################
# Naming Symbols
################################################################

# constant_fields - Define constant fields
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.required_modifiers = const

# private and protected constant fields
dotnet_naming_symbols.private_and_protected_constant_fields.applicable_kinds = fields
dotnet_naming_symbols.private_and_protected_constant_fields.applicable_accessibilities = private, protected
dotnet_naming_symbols.private_and_protected_constant_fields.required_modifiers = const

# non_private_readonly_fields - Define public, internal and protected readonly fields
dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public, internal, protected
dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly

# static_readonly_fields - Define static and readonly fields
dotnet_naming_symbols.static_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.static_readonly_fields.required_modifiers = static, readonly

# class_interface_symbols - Define any symbol that is part of a class' interface
dotnet_naming_symbols.class_interface_symbols.applicable_kinds = method, property, event, delegate

# parameters - Defines any parameter
dotnet_naming_symbols.parameters.applicable_kinds = parameter

# non_interface_types - Defines class, struct, enum and delegate types
dotnet_naming_symbols.non_interface_types.applicable_kinds = class, struct, enum, delegate

# interface_types - Defines interfaces
dotnet_naming_symbols.interface_types.applicable_kinds = interface

# non_public_member_variables
dotnet_naming_symbols.non_public_member_variables.applicable_kinds = field
dotnet_naming_symbols.non_public_member_variables.applicable_accessibilities = internal, friend, private, protected, protected_internal, protected_friend

# namespaces
dotnet_naming_symbols.namespaces.applicable_kinds = namespace

################################################################
# Naming Styles
################################################################

# camel_case - Define the camelCase style
dotnet_naming_style.camel_case.capitalization = camel_case

# pascal_case - Define the Pascal_case style
dotnet_naming_style.pascal_case.capitalization = pascal_case

# first_upper - The first character must start with an upper-case character
dotnet_naming_style.first_upper.capitalization = first_word_upper

# prefix_interface_interface_with_i - Interfaces must be PascalCase and the first character of an interface must be an 'I'
dotnet_naming_style.prefix_interface_interface_with_i.capitalization = pascal_case
dotnet_naming_style.prefix_interface_interface_with_i.required_prefix = I

# upper_constants
dotnet_naming_style.upper_constants.capitalization = all_upper
dotnet_naming_style.upper_constants.word_separator = _

# underscore_prefix
dotnet_naming_style.underscore_prefix.required_prefix = _
dotnet_naming_style.underscore_prefix.capitalization = camel_case

################################################################
# Naming Rules
################################################################
# missing rule: local_variables_must_be_camel_case https://github.com/dotnet/roslyn/issues/18121

# private constant fields must be upper_case
dotnet_naming_rule.private_and_protected_constant_fields_must_be_upper_case.severity = warning
dotnet_naming_rule.private_and_protected_constant_fields_must_be_upper_case.symbols = private_and_protected_constant_fields
dotnet_naming_rule.private_and_protected_constant_fields_must_be_upper_case.style = upper_constants

# non public member variables must be prefixed with _
dotnet_naming_rule.non_public_member_variables_must_be_prefixed_with_underscore.severity = warning
dotnet_naming_rule.non_public_member_variables_must_be_prefixed_with_underscore.symbols = non_public_member_variables
dotnet_naming_rule.non_public_member_variables_must_be_prefixed_with_underscore.style = underscore_prefix

# Static readonly fields must be PascalCase
dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.severity = warning
dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.symbols = static_readonly_fields
dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.style = pascal_case

# Class, struct, enum and delegates must be PascalCase
dotnet_naming_rule.non_interface_types_must_be_pascal_case.severity = warning
dotnet_naming_rule.non_interface_types_must_be_pascal_case.symbols = non_interface_types
dotnet_naming_rule.non_interface_types_must_be_pascal_case.style = pascal_case

# Constant fields must be Upper Case (also forces enums to be upper case)
# https://stackoverflow.com/questions/45120852/editorconfig-const-enum-settings-not-working-in-visual-studio
#
#dotnet_naming_rule.constant_fields_must_be_upper_case.severity = warning
#dotnet_naming_rule.constant_fields_must_be_upper_case.symbols = constant_fields
#dotnet_naming_rule.constant_fields_must_be_upper_case.style = upper_constants

# Public members must be capitalized
dotnet_naming_rule.public_members_must_be_capitalized.severity = warning
dotnet_naming_rule.public_members_must_be_capitalized.symbols = class_interface_symbols
dotnet_naming_rule.public_members_must_be_capitalized.style = first_upper

# Parameters must be camelCase
dotnet_naming_rule.parameters_must_be_camel_case.severity = warning
dotnet_naming_rule.parameters_must_be_camel_case.symbols = parameters
dotnet_naming_rule.parameters_must_be_camel_case.style = camel_case

# Interfaces must be PascalCase and start with an 'I'
dotnet_naming_rule.interface_types_must_be_prefixed_with_i.severity = warning
dotnet_naming_rule.interface_types_must_be_prefixed_with_i.symbols = interface_types
dotnet_naming_rule.interface_types_must_be_prefixed_with_i.style = prefix_interface_interface_with_i

# Namespaces must be written in pascal case
dotnet_naming_rule.namespaces_must_be_pasacl_case.severity = warning
dotnet_naming_rule.namespaces_must_be_pasacl_case.symbols = namespaces
dotnet_naming_rule.namespaces_must_be_pasacl_case.style = pascal_case

# Namespaces
csharp_style_namespace_declarations = file_scoped:warning

################################################################
# Analyzers
################################################################
dotnet_diagnostic.IDE0005.severity = warning # Using directive is unnecessary

# because this call is not awaited, execution of the current method continues before the call is completed
dotnet_diagnostic.CS4014.severity = error
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Cake tools
[Tt]ools/

# Build output
[Bb]uildArtifacts/

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
Expand Down
12 changes: 12 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project>

<PropertyGroup>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>

</Project>
1 change: 1 addition & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
commit-message-incrementing: Disabled
37 changes: 37 additions & 0 deletions NServiceBus.Persistence.Sqlite.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.7.34031.279
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.Persistence.Sqlite", "src\NServiceBus.Persistence.Sqlite\NServiceBus.Persistence.Sqlite.csproj", "{A965F01A-4CA7-48D9-B977-85AD72FADDBB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Persistence.Sqlite.Tests", "tests\NServiceBus.Persistence.Sqlite.Tests\NServiceBus.Persistence.Sqlite.Tests.csproj", "{547FF4AD-BFB1-40BE-BAE1-FB431DA04042}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestClient", "samples\TestClient\TestClient.csproj", "{23269682-5DD4-4D31-8460-881511A343E0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A965F01A-4CA7-48D9-B977-85AD72FADDBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A965F01A-4CA7-48D9-B977-85AD72FADDBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A965F01A-4CA7-48D9-B977-85AD72FADDBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A965F01A-4CA7-48D9-B977-85AD72FADDBB}.Release|Any CPU.Build.0 = Release|Any CPU
{547FF4AD-BFB1-40BE-BAE1-FB431DA04042}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{547FF4AD-BFB1-40BE-BAE1-FB431DA04042}.Debug|Any CPU.Build.0 = Debug|Any CPU
{547FF4AD-BFB1-40BE-BAE1-FB431DA04042}.Release|Any CPU.ActiveCfg = Release|Any CPU
{547FF4AD-BFB1-40BE-BAE1-FB431DA04042}.Release|Any CPU.Build.0 = Release|Any CPU
{23269682-5DD4-4D31-8460-881511A343E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23269682-5DD4-4D31-8460-881511A343E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23269682-5DD4-4D31-8460-881511A343E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23269682-5DD4-4D31-8460-881511A343E0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5D20EC76-DC40-4AC6-9B00-CF2CE3DC0B65}
EndGlobalSection
EndGlobal
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
# NServiceBus.Persistence.Sqlite

![Build](https://github.com/CHG-MERIDIAN/NServiceBus.Persistence.Sqlite/workflows/Build%20(and%20release)/badge.svg?branch=main)
[![NuGet Version](http://img.shields.io/nuget/v/CHG.NServiceBus.Persistence.Sqlite.svg?style=flat)](https://www.nuget.org/packages/CHG.NServiceBus.Persistence.Sqlite/) [![License](https://img.shields.io/badge/license-APACHE-blue.svg)](LICENSE)

[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=CHG-MERIDIAN_NServiceBus.Persistence.Sqlite&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=CHG-MERIDIAN_NServiceBus.Persistence.Sqlite)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=CHG-MERIDIAN_NServiceBus.Persistence.Sqlite&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=CHG-MERIDIAN_NServiceBus.Persistence.Sqlite)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=CHG-MERIDIAN_NServiceBus.Persistence.Sqlite&metric=security_rating)](https://sonarcloud.io/dashboard?id=CHG-MERIDIAN_NServiceBus.Persistence.Sqlite)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=CHG-MERIDIAN_NServiceBus.Persistence.Sqlite&metric=bugs)](https://sonarcloud.io/dashboard?id=CHG-MERIDIAN_NServiceBus.Persistence.Sqlite)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=CHG-MERIDIAN_NServiceBus.Persistence.Sqlite&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=CHG-MERIDIAN_NServiceBus.Persistence.Sqlite)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=CHG-MERIDIAN_NServiceBus.Persistence.Sqlite&metric=coverage)](https://sonarcloud.io/dashboard?id=CHG-MERIDIAN_NServiceBus.Persistence.Sqlite)

NServiceBus persistence implementation for Sqlite

## Usage

Install the NuGet package `CHG.NServiceBus.Persistence.Sqlite`.

```CSharp
var persistence = endpointConfiguration.UsePersistence<SqlitePersistence>();
persistence.UseConnectionString("Data Source=file:SagaStore.db");
```
Loading

0 comments on commit b11ec33

Please sign in to comment.