Skip to content

Commit 6a0f1bf

Browse files
committed
Update README with quick start guide and examples for microservices and database-driven applications
1 parent 437c9e4 commit 6a0f1bf

File tree

1 file changed

+103
-18
lines changed

1 file changed

+103
-18
lines changed

README.md

Lines changed: 103 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ Edit your VS Code settings (`Ctrl+,` or `Cmd+,`, search for "mcp"):
310310

311311
Once configured, you can use natural language with your AI assistant:
312312

313-
### Getting Started
313+
### Quick Start - Single Project
314314

315315
**User**: *"Create a new web API project called WeatherService"*
316316

@@ -322,43 +322,128 @@ dotnet new webapi -n WeatherService
322322

323323
*The project has been created successfully in the WeatherService directory.*
324324

325-
### Managing Packages
325+
### Complex Application - Microservices with Aspire
326326

327-
**User**: *"Add Entity Framework Core and the SQL Server provider to my project"*
327+
**User**: *"Create a server-side web app and minimal API, orchestrated by .NET Aspire, with unit tests for the API using xunit. Use slnx format for the solution."*
328328

329-
**AI**: *I'll add both packages...*
329+
**AI**: *I'll create a complete microservices solution with .NET Aspire orchestration...*
330330

331331
```bash
332+
# Create solution with new XML format
333+
dotnet new sln -n MyMicroservices --use-slnx
334+
335+
# Create .NET Aspire AppHost for orchestration
336+
dotnet new aspire-apphost -n MyMicroservices.AppHost
337+
338+
# Create web app
339+
dotnet new webapp -n MyMicroservices.Web
340+
341+
# Create minimal API
342+
dotnet new webapi -n MyMicroservices.Api --use-minimal-apis
343+
344+
# Create test project
345+
dotnet new xunit -n MyMicroservices.Api.Tests
346+
347+
# Add projects to solution
348+
dotnet sln add MyMicroservices.AppHost/MyMicroservices.AppHost.csproj
349+
dotnet sln add MyMicroservices.Web/MyMicroservices.Web.csproj
350+
dotnet sln add MyMicroservices.Api/MyMicroservices.Api.csproj
351+
dotnet sln add MyMicroservices.Api.Tests/MyMicroservices.Api.Tests.csproj
352+
353+
# Add project references for tests
354+
dotnet add MyMicroservices.Api.Tests/MyMicroservices.Api.Tests.csproj reference MyMicroservices.Api/MyMicroservices.Api.csproj
355+
```
356+
357+
*Solution created with 4 projects: AppHost for orchestration, Web app, API, and unit tests. Ready to run with `dotnet run --project MyMicroservices.AppHost`.*
358+
359+
### Database-Driven Application
360+
361+
**User**: *"Add Entity Framework Core with SQL Server to my API project, and create a NuGet package for my data models"*
362+
363+
**AI**: *I'll add EF Core with SQL Server and configure package creation...*
364+
365+
```bash
366+
# Add Entity Framework packages
332367
dotnet add package Microsoft.EntityFrameworkCore
333368
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
369+
dotnet add package Microsoft.EntityFrameworkCore.Design
370+
371+
# Create a data models class library
372+
dotnet new classlib -n MyMicroservices.Models
373+
374+
# Configure for NuGet packaging
375+
dotnet pack MyMicroservices.Models/MyMicroservices.Models.csproj -c Release
334376
```
335377

336-
*Both packages have been added successfully.*
378+
*Entity Framework Core with SQL Server provider added. Created a separate Models project that can be packaged and shared.*
337379

338-
### Building and Testing
380+
### Multi-Target Testing Strategy
339381

340-
**User**: *"Build my solution in Release mode and run all tests"*
382+
**User**: *"Add integration tests using NUnit that target both .NET 8 and .NET 9, and configure them to run with code coverage"*
341383

342-
**AI**: *I'll build and test your solution...*
384+
**AI**: *I'll set up multi-targeted integration tests with coverage...*
343385

344386
```bash
345-
dotnet build -c Release
346-
dotnet test
387+
# Create NUnit test project
388+
dotnet new nunit -n MyMicroservices.IntegrationTests
389+
390+
# Update project to multi-target (edit .csproj)
391+
# <TargetFrameworks>net8.0;net9.0</TargetFrameworks>
392+
393+
# Add integration test packages
394+
dotnet add MyMicroservices.IntegrationTests package Microsoft.AspNetCore.Mvc.Testing
395+
dotnet add MyMicroservices.IntegrationTests package coverlet.collector
396+
397+
# Run tests with coverage for both frameworks
398+
dotnet test --collect:"XPlat Code Coverage"
399+
```
400+
401+
*Integration test project created with multi-targeting. Tests will run on both .NET 8 and .NET 9 with code coverage enabled.*
402+
403+
### Exploring and Discovering
404+
405+
**User**: *"What templates are available for creating cloud-native applications?"*
406+
407+
**AI**: *Let me search for cloud-native related templates...*
408+
409+
```bash
410+
dotnet new search aspire
411+
dotnet new search dapr
412+
dotnet new search azure
347413
```
348414

349-
*Build succeeded. All 47 tests passed.*
415+
*Found templates:*
350416

351-
### Exploring Options
417+
- `aspire` - .NET Aspire Application
418+
- `aspire-apphost` - .NET Aspire App Host
419+
- `aspire-servicedefaults` - .NET Aspire Service Defaults
420+
- `dapr` - Dapr application templates
421+
- Various Azure Functions and Container Apps templates
352422

353-
**User**: *"What Blazor templates are available?"*
423+
*Each template is designed for cloud-native microservices and distributed applications.*
354424

355-
**AI**: *Here are the available Blazor templates:*
425+
### Modernization Workflow
356426

357-
- `blazor` - Blazor Web App
358-
- `blazorwasm` - Blazor WebAssembly App
359-
- `blazorserver` - Blazor Server App
427+
**User**: *"Update all packages to latest versions, format all code to match our editorconfig rules, then build and run tests"*
428+
429+
**AI**: *I'll update packages, format code, build, and test...*
430+
431+
```bash
432+
# Update all packages to latest compatible versions
433+
dotnet package update
434+
435+
# Format all code according to .editorconfig
436+
dotnet format
437+
438+
# Clean and rebuild
439+
dotnet clean
440+
dotnet build -c Release
441+
442+
# Run all tests
443+
dotnet test --logger "console;verbosity=detailed"
444+
```
360445

361-
*Each template supports different hosting models and configurations.*
446+
*All packages updated to latest versions. Code formatted consistently across solution. Build succeeded with 0 warnings. All 156 tests passed.*
362447

363448
## Available Tools
364449

0 commit comments

Comments
 (0)