Issue Creation and Branching:
If unsure about code validity, assign a code reviewer.
*It might be easier for you to pull main, into the feature branch, testing it, and then pulling feature to main
We follow a DB-first approach for this project. This means that the database schema is designed first, and the code is generated based on that schema. Changes to the database structure are reflected in the API via code generation tools (e.g., Entity Framework for C# or other ORM frameworks, like dapper).
Workflow:
dotnet ef dbcontext scaffold "server=[server];port=[port];user=[user];password=[password];database=VTA" Pomelo.EntityFrameworkCore.MySql -o scaffold -f
for the entire database.dotnet ef dbcontext scaffold "server=[server];port=[port];user=[user];password=[password];database=VTA" Pomelo.EntityFrameworkCore.MySql -o scaffold --table [Table1] --table [Table2] -f
for only specific tables.Code generation: Ensure consistency between the database and the code by regenerating models after every schema update.
*These commands are configured to output to the folder scaffold
.
**The autogenerated DBContext contains every single "table" from the DBcontext, this however, can impact concurrency, therefore we split it up, if you are unsure about how to, reffer to the existing DBContexts
PascalCase/UpperCamelCase
.
class SliderMenu { ... }
typedef Predicate<T> = bool Function(T value);
PascalCase/UpperCamelCase
.
extension MyFancyList<T> on List<T> { ... }
camelCase/lowerCamelCase
.
var itemCount = 3;
void alignItems(bool clearItems) { ... }
lowercase_with_underscores
.
lib/
my_widget.dart
utils/
string_helpers.dart
lowercase_with_underscores
.
class HttpRequest { ... }
``
### Formatting your dart code
Use ``dart format`` to format your code
For other formatting guidlines refer to [dart.dev styling guidlines](https://dart.dev/effective-dart/style)
# [DOCUMENT YOUR CODE!](https://dart.dev/effective-dart/documentation)
## API Naming Conventions (C#)
### Types CSharp
PascalCase
.
class MyClass { ... }
enum Colors { Red, Green, Blue }
PascalCase
.
public void FetchData() { ... }
public string Name { get; set; }
camelCase
.
int itemCount = 3;
void SetItemCount(int itemCount) { ... }
PascalCase
with the const
modifier.
const int MaxItems = 10;
PascalCase
.
public interface IMyInterface { ... }
PascalCase
.
namespace MyApplication.Data
{
// ...
}
PascalCase
for file names.
MyClass.cs
IMyInterface.cs
Colors.cs
PascalCase
.
class IOHandler { ... }
class HttpRequest { ... }
///
). Refer to Microsoft documentation guidelines.