Example: Task list app
This quick guide walks you through recreating the simple TO-DOs (task list) app.
1. Create a new ASP.NET Core application in Visual Studio
public class Startup : RevoStartup
{
public Startup(IConfiguration configuration) : base(configuration)
{
}
/*** CODE OMITTED FOR BREVITY ***/
protected override IRevoConfiguration CreateRevoConfiguration()
{
return new RevoConfiguration()
.UseAspNetCore()
.UseEFCoreDataAccess(
contextBuilder => contextBuilder
//.UseSqlite("Data Source=todos.db"), // for real applications, you'll want to switch to more featured RDBMS as shown below.
.UseNpgsql(connectionString) // for PostgreSQL
// .UseSqlServer(connectionString) // for SQL Server you will also need to comment out SnakeCaseColumnNamesConvention and LowerCaseConventionbelow
advancedAction: config =>
{
config
.AddConvention<BaseTypeAttributeConvention>(-200)
.AddConvention<IdColumnsPrefixedWithTableNameConvention>(-110)
.AddConvention<PrefixConvention>(-9)
.AddConvention<SnakeCaseTableNamesConvention>(1)
.AddConvention<SnakeCaseColumnNamesConvention>(1)
.AddConvention<LowerCaseConvention>(2);
})
.UseAllEFCoreInfrastructure();
}
}2. Define domain model
2.1. Aggregate and entities
2.2 Domain events
3. Writing data with commands
3.1. Commands
3.2. Command handler
4. Querying data from read model
4.1. Read model
4.2. Queries
4.3. Query handler
4.4. Projector
5. ASP.NET Core controller
6. Finish!
Last updated