Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

FAST

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

FAST COMMUNITY

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

OPEN SOURCE FAST COMMUNITY

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); app.MapGet("/hello-world", () => "Hallo Basta"); app.Run(); 1 2 3 4 5

Slide 14

Slide 14 text

var builder = WebApplication.CreateBuilder(args); builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var app = builder.Build(); if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } app.UseHttpsRedirection(); app.MapGet("/hello-world", () => new Greeting("Hallo Basta!")) .WithName("HelloWorld") .WithOpenApi(); app.Run(); record Greeting(string Message); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

Slide 15

Slide 15 text

var builder = WebApplication.CreateBuilder(args); builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var app = builder.Build(); if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } app.UseHttpsRedirection(); app.MapGet("/hello-world", () => new Greeting("Hallo Basta!")) .WithName("HelloWorld") .WithOpenApi(); app.Run(); record Greeting(string Message); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 app.MapGet("/hello-world", () => new Greeting("Hallo Basta!")) var builder = WebApplication.CreateBuilder(args); 1 2 builder.Services.AddEndpointsApiExplorer(); 3 builder.Services.AddSwaggerGen(); 4 5 var app = builder.Build(); 6 7 if (app.Environment.IsDevelopment()) 8 { 9 app.UseSwagger(); 10 app.UseSwaggerUI(); 11 } 12 13 app.UseHttpsRedirection(); 14 15 16 .WithName("HelloWorld") 17 .WithOpenApi(); 18 19 app.Run(); 20 21 record Greeting(string Message); 22

Slide 16

Slide 16 text

var builder = WebApplication.CreateBuilder(args); builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var app = builder.Build(); if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } app.UseHttpsRedirection(); app.MapGet("/hello-world", () => new Greeting("Hallo Basta!")) .WithName("HelloWorld") .WithOpenApi(); app.Run(); record Greeting(string Message); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 app.MapGet("/hello-world", () => new Greeting("Hallo Basta!")) var builder = WebApplication.CreateBuilder(args); 1 2 builder.Services.AddEndpointsApiExplorer(); 3 builder.Services.AddSwaggerGen(); 4 5 var app = builder.Build(); 6 7 if (app.Environment.IsDevelopment()) 8 { 9 app.UseSwagger(); 10 app.UseSwaggerUI(); 11 } 12 13 app.UseHttpsRedirection(); 14 15 16 .WithName("HelloWorld") 17 .WithOpenApi(); 18 19 app.Run(); 20 21 record Greeting(string Message); 22 builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var builder = WebApplication.CreateBuilder(args); 1 2 3 4 5 var app = builder.Build(); 6 7 if (app.Environment.IsDevelopment()) 8 { 9 app.UseSwagger(); 10 app.UseSwaggerUI(); 11 } 12 13 app.UseHttpsRedirection(); 14 15 app.MapGet("/hello-world", () => new Greeting("Hallo Basta!")) 16 .WithName("HelloWorld") 17 .WithOpenApi(); 18 19 app.Run(); 20 21 record Greeting(string Message); 22

Slide 17

Slide 17 text

var builder = WebApplication.CreateBuilder(args); builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var app = builder.Build(); if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } app.UseHttpsRedirection(); app.MapGet("/hello-world", () => new Greeting("Hallo Basta!")) .WithName("HelloWorld") .WithOpenApi(); app.Run(); record Greeting(string Message); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 app.MapGet("/hello-world", () => new Greeting("Hallo Basta!")) var builder = WebApplication.CreateBuilder(args); 1 2 builder.Services.AddEndpointsApiExplorer(); 3 builder.Services.AddSwaggerGen(); 4 5 var app = builder.Build(); 6 7 if (app.Environment.IsDevelopment()) 8 { 9 app.UseSwagger(); 10 app.UseSwaggerUI(); 11 } 12 13 app.UseHttpsRedirection(); 14 15 16 .WithName("HelloWorld") 17 .WithOpenApi(); 18 19 app.Run(); 20 21 record Greeting(string Message); 22 builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var builder = WebApplication.CreateBuilder(args); 1 2 3 4 5 var app = builder.Build(); 6 7 if (app.Environment.IsDevelopment()) 8 { 9 app.UseSwagger(); 10 app.UseSwaggerUI(); 11 } 12 13 app.UseHttpsRedirection(); 14 15 app.MapGet("/hello-world", () => new Greeting("Hallo Basta!")) 16 .WithName("HelloWorld") 17 .WithOpenApi(); 18 19 app.Run(); 20 21 record Greeting(string Message); 22 builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); app.UseSwagger(); app.UseSwaggerUI(); .WithName("HelloWorld") .WithOpenApi(); var builder = WebApplication.CreateBuilder(args); 1 2 3 4 5 var app = builder.Build(); 6 7 if (app.Environment.IsDevelopment()) 8 { 9 10 11 } 12 13 app.UseHttpsRedirection(); 14 15 app.MapGet("/hello-world", () => new Greeting("Hallo Basta!")) 16 17 18 19 app.Run(); 20 21 record Greeting(string Message); 22

Slide 18

Slide 18 text

builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); app.UseSwagger(); app.UseSwaggerUI(); .WithName("HelloWorld") .WithOpenApi(); var builder = WebApplication.CreateBuilder(args); 1 2 3 4 5 var app = builder.Build(); 6 7 if (app.Environment.IsDevelopment()) 8 { 9 10 11 } 12 13 app.UseHttpsRedirection(); 14 15 app.MapGet("/hello-world", () => new Greeting("Hallo Basta!")) 16 17 18 19 app.Run(); 20 21 record Greeting(string Message); 22

Slide 19

Slide 19 text

builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); app.UseSwagger(); app.UseSwaggerUI(); .WithName("HelloWorld") .WithOpenApi(); var builder = WebApplication.CreateBuilder(args); 1 2 3 4 5 var app = builder.Build(); 6 7 if (app.Environment.IsDevelopment()) 8 { 9 10 11 } 12 13 app.UseHttpsRedirection(); 14 15 app.MapGet("/hello-world", () => new Greeting("Hallo Basta!")) 16 17 18 19 app.Run(); 20 21 record Greeting(string Message); 22

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

https://scalar.com/

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

app.MapGet("/api/user/", () => { }) .WithOpenApi() .WithName("GetUser"); userGroup.MapPost("/api/user/", (CreateUserDto dto) => { }) .WithOpenApi() .WithName("CreateUser"); userGroup.MapDelete("/api/user/", (DeleteUserDto dto) => { }) .WithOpenApi() .WithName("DeleteUser"); 1 2 3 4 5 6 7 8 9 10 11

Slide 24

Slide 24 text

// User Controller var userGroup = app.MapGroup("/api/user") .WithOpenApi(); userGroup.MapGet("/", () => { }) .WithName("GetUser"); userGroup.MapPost("/", (CreateUserDto dto) => { }) .WithName("CreateUser"); userGroup.MapDelete("/", (DeleteUserDto dto) => { }) .WithName("DeleteUser"); 1 2 3 4 5 6 7 8 9 10 11 12

Slide 25

Slide 25 text

public static class UserController { public static void UseUserController(this IEndpointRouteBuilder app) { var userGroup = app .MapGroup("/api/user") .WithOpenApi(); userGroup .MapGet("/", () => { }) .WithName("GetUser"); userGroup .MapPost("/", (CreateUserDto dto) => { }) .WithName("CreateUser"); userGroup .MapDelete("/", (DeleteUserDto dto) => { }) .WithName("DeleteUser"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

Slide 26

Slide 26 text

public static class UserController { public static void UseUserController(this IEndpointRouteBuilder app) { var userGroup = app .MapGroup("/api/user") .WithOpenApi(); userGroup .MapGet("/", () => { }) .WithName("GetUser"); userGroup .MapPost("/", (CreateUserDto dto) => { }) .WithName("CreateUser"); userGroup .MapDelete("/", (DeleteUserDto dto) => { }) .WithName("DeleteUser"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 app.UseUserController(); // Configure the HTTP request pipeline. 1 app.UseSwagger(); 2 app.UseSwaggerUI(); 3 4 // Now we have a very convient way 5 // of defining our own endpoints 6 7

Slide 27

Slide 27 text

([AsParameters]GreetingRequest request, record GreetingRequest([FromQuery]string Name); var builder = WebApplication.CreateBuilder(args); 1 2 builder.Services.AddScoped(); 3 4 var app = builder.Build(); 5 6 // ... 7 8 app.MapGet("/greet", 9 10 GreetingService service) 11 => service.GetGreeting(request.Name)); 12 13 14 app.Run(); 15 16 public class GreetingService 17 { 18 public string GetGreeting(string name) => $"Hello {name}!"; 19 } 20

Slide 28

Slide 28 text

([AsParameters]GreetingRequest request, record GreetingRequest([FromQuery]string Name); var builder = WebApplication.CreateBuilder(args); 1 2 builder.Services.AddScoped(); 3 4 var app = builder.Build(); 5 6 // ... 7 8 app.MapGet("/greet", 9 10 GreetingService service) 11 => service.GetGreeting(request.Name)); 12 13 14 app.Run(); 15 16 public class GreetingService 17 { 18 public string GetGreeting(string name) => $"Hello {name}!"; 19 } 20 builder.Services.AddScoped(); GreetingService service) public class GreetingService { public string GetGreeting(string name) => $"Hello {name}!"; } var builder = WebApplication.CreateBuilder(args); 1 2 3 4 var app = builder.Build(); 5 6 // ... 7 8 app.MapGet("/greet", 9 ([AsParameters]GreetingRequest request, 10 11 => service.GetGreeting(request.Name)); 12 13 14 app.Run(); 15 record GreetingRequest([FromQuery]string Name); 16 17 18 19 20

Slide 29

Slide 29 text

([AsParameters]GreetingRequest request, record GreetingRequest([FromQuery]string Name); var builder = WebApplication.CreateBuilder(args); 1 2 builder.Services.AddScoped(); 3 4 var app = builder.Build(); 5 6 // ... 7 8 app.MapGet("/greet", 9 10 GreetingService service) 11 => service.GetGreeting(request.Name)); 12 13 14 app.Run(); 15 16 public class GreetingService 17 { 18 public string GetGreeting(string name) => $"Hello {name}!"; 19 } 20 builder.Services.AddScoped(); GreetingService service) public class GreetingService { public string GetGreeting(string name) => $"Hello {name}!"; } var builder = WebApplication.CreateBuilder(args); 1 2 3 4 var app = builder.Build(); 5 6 // ... 7 8 app.MapGet("/greet", 9 ([AsParameters]GreetingRequest request, 10 11 => service.GetGreeting(request.Name)); 12 13 14 app.Run(); 15 record GreetingRequest([FromQuery]string Name); 16 17 18 19 20 app.MapGet("/greet", ([AsParameters]GreetingRequest request, GreetingService service) => service.GetGreeting(request.Name)); var builder = WebApplication.CreateBuilder(args); 1 2 builder.Services.AddScoped(); 3 4 var app = builder.Build(); 5 6 // ... 7 8 9 10 11 12 13 14 app.Run(); 15 record GreetingRequest([FromQuery]string Name); 16 public class GreetingService 17 { 18 public string GetGreeting(string name) => $"Hello {name}!"; 19 } 20

Slide 30

Slide 30 text

([AsParameters]GreetingRequest request, record GreetingRequest([FromQuery]string Name); var builder = WebApplication.CreateBuilder(args); 1 2 builder.Services.AddScoped(); 3 4 var app = builder.Build(); 5 6 // ... 7 8 app.MapGet("/greet", 9 10 GreetingService service) 11 => service.GetGreeting(request.Name)); 12 13 14 app.Run(); 15 16 public class GreetingService 17 { 18 public string GetGreeting(string name) => $"Hello {name}!"; 19 } 20 builder.Services.AddScoped(); GreetingService service) public class GreetingService { public string GetGreeting(string name) => $"Hello {name}!"; } var builder = WebApplication.CreateBuilder(args); 1 2 3 4 var app = builder.Build(); 5 6 // ... 7 8 app.MapGet("/greet", 9 ([AsParameters]GreetingRequest request, 10 11 => service.GetGreeting(request.Name)); 12 13 14 app.Run(); 15 record GreetingRequest([FromQuery]string Name); 16 17 18 19 20 app.MapGet("/greet", ([AsParameters]GreetingRequest request, GreetingService service) => service.GetGreeting(request.Name)); var builder = WebApplication.CreateBuilder(args); 1 2 builder.Services.AddScoped(); 3 4 var app = builder.Build(); 5 6 // ... 7 8 9 10 11 12 13 14 app.Run(); 15 record GreetingRequest([FromQuery]string Name); 16 public class GreetingService 17 { 18 public string GetGreeting(string name) => $"Hello {name}!"; 19 } 20 var builder = WebApplication.CreateBuilder(args); builder.Services.AddScoped(); var app = builder.Build(); // ... app.MapGet("/greet", ([AsParameters]GreetingRequest request, GreetingService service) => service.GetGreeting(request.Name)); app.Run(); record GreetingRequest([FromQuery]string Name); public class GreetingService { public string GetGreeting(string name) => $"Hello {name}!"; } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

builder.Services.AddDbContext(optionsBuilder => { optionsBuilder.UseSqlite("Data Source=app.db"); }); // .. app.RegisterExpenseEndpoints(); app.UseExceptionHandler(); app.Use(async (context, next) => { var logger = app.Logger; var displayUrl = context.Request.GetDisplayUrl(); logger.LogDebug("Before Request with Uri '{Uri}'", displayUrl); await next(context); logger.LogDebug("After Request with Uri '{Uri}'", displayUrl); }); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Slide 33

Slide 33 text

builder.Services.AddDbContext(optionsBuilder => { optionsBuilder.UseSqlite("Data Source=app.db"); }); // .. app.RegisterExpenseEndpoints(); app.UseExceptionHandler(); app.Use(async (context, next) => { var logger = app.Logger; var displayUrl = context.Request.GetDisplayUrl(); logger.LogDebug("Before Request with Uri '{Uri}'", displayUrl); await next(context); logger.LogDebug("After Request with Uri '{Uri}'", displayUrl); }); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 builder.Services.AddDbContext(optionsBuilder => { optionsBuilder.UseSqlite("Data Source=app.db"); 1 2 3 }); 4 5 // .. 6 7 app.RegisterExpenseEndpoints(); 8 9 10 app.UseExceptionHandler(); 11 12 app.Use(async (context, next) => 13 { 14 var logger = app.Logger; 15 var displayUrl = context.Request.GetDisplayUrl(); 16 logger.LogDebug("Before Request with Uri '{Uri}'", displayUrl); 17 await next(context); 18 logger.LogDebug("After Request with Uri '{Uri}'", displayUrl); 19 }); 20

Slide 34

Slide 34 text

builder.Services.AddDbContext(optionsBuilder => { optionsBuilder.UseSqlite("Data Source=app.db"); }); // .. app.RegisterExpenseEndpoints(); app.UseExceptionHandler(); app.Use(async (context, next) => { var logger = app.Logger; var displayUrl = context.Request.GetDisplayUrl(); logger.LogDebug("Before Request with Uri '{Uri}'", displayUrl); await next(context); logger.LogDebug("After Request with Uri '{Uri}'", displayUrl); }); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 builder.Services.AddDbContext(optionsBuilder => { optionsBuilder.UseSqlite("Data Source=app.db"); 1 2 3 }); 4 5 // .. 6 7 app.RegisterExpenseEndpoints(); 8 9 10 app.UseExceptionHandler(); 11 12 app.Use(async (context, next) => 13 { 14 var logger = app.Logger; 15 var displayUrl = context.Request.GetDisplayUrl(); 16 logger.LogDebug("Before Request with Uri '{Uri}'", displayUrl); 17 await next(context); 18 logger.LogDebug("After Request with Uri '{Uri}'", displayUrl); 19 }); 20 app.UseExceptionHandler(); builder.Services.AddDbContext(optionsBuilder => 1 { 2 optionsBuilder.UseSqlite("Data Source=app.db"); 3 }); 4 5 // .. 6 7 app.RegisterExpenseEndpoints(); 8 9 10 11 12 app.Use(async (context, next) => 13 { 14 var logger = app.Logger; 15 var displayUrl = context.Request.GetDisplayUrl(); 16 logger.LogDebug("Before Request with Uri '{Uri}'", displayUrl); 17 await next(context); 18 logger.LogDebug("After Request with Uri '{Uri}'", displayUrl); 19 }); 20

Slide 35

Slide 35 text

builder.Services.AddDbContext(optionsBuilder => { optionsBuilder.UseSqlite("Data Source=app.db"); }); // .. app.RegisterExpenseEndpoints(); app.UseExceptionHandler(); app.Use(async (context, next) => { var logger = app.Logger; var displayUrl = context.Request.GetDisplayUrl(); logger.LogDebug("Before Request with Uri '{Uri}'", displayUrl); await next(context); logger.LogDebug("After Request with Uri '{Uri}'", displayUrl); }); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 builder.Services.AddDbContext(optionsBuilder => { optionsBuilder.UseSqlite("Data Source=app.db"); 1 2 3 }); 4 5 // .. 6 7 app.RegisterExpenseEndpoints(); 8 9 10 app.UseExceptionHandler(); 11 12 app.Use(async (context, next) => 13 { 14 var logger = app.Logger; 15 var displayUrl = context.Request.GetDisplayUrl(); 16 logger.LogDebug("Before Request with Uri '{Uri}'", displayUrl); 17 await next(context); 18 logger.LogDebug("After Request with Uri '{Uri}'", displayUrl); 19 }); 20 app.UseExceptionHandler(); builder.Services.AddDbContext(optionsBuilder => 1 { 2 optionsBuilder.UseSqlite("Data Source=app.db"); 3 }); 4 5 // .. 6 7 app.RegisterExpenseEndpoints(); 8 9 10 11 12 app.Use(async (context, next) => 13 { 14 var logger = app.Logger; 15 var displayUrl = context.Request.GetDisplayUrl(); 16 logger.LogDebug("Before Request with Uri '{Uri}'", displayUrl); 17 await next(context); 18 logger.LogDebug("After Request with Uri '{Uri}'", displayUrl); 19 }); 20 app.Use(async (context, next) => { var logger = app.Logger; var displayUrl = context.Request.GetDisplayUrl(); logger.LogDebug("Before Request with Uri '{Uri}'", displayUrl); await next(context); logger.LogDebug("After Request with Uri '{Uri}'", displayUrl); }); builder.Services.AddDbContext(optionsBuilder => 1 { 2 optionsBuilder.UseSqlite("Data Source=app.db"); 3 }); 4 5 // .. 6 7 app.RegisterExpenseEndpoints(); 8 9 10 app.UseExceptionHandler(); 11 12 13 14 15 16 17 18 19 20

Slide 36

Slide 36 text

builder.Services.AddDbContext(optionsBuilder => { optionsBuilder.UseSqlite("Data Source=app.db"); }); // .. app.RegisterExpenseEndpoints(); app.UseExceptionHandler(); app.Use(async (context, next) => { var logger = app.Logger; var displayUrl = context.Request.GetDisplayUrl(); logger.LogDebug("Before Request with Uri '{Uri}'", displayUrl); await next(context); logger.LogDebug("After Request with Uri '{Uri}'", displayUrl); }); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 builder.Services.AddDbContext(optionsBuilder => { optionsBuilder.UseSqlite("Data Source=app.db"); 1 2 3 }); 4 5 // .. 6 7 app.RegisterExpenseEndpoints(); 8 9 10 app.UseExceptionHandler(); 11 12 app.Use(async (context, next) => 13 { 14 var logger = app.Logger; 15 var displayUrl = context.Request.GetDisplayUrl(); 16 logger.LogDebug("Before Request with Uri '{Uri}'", displayUrl); 17 await next(context); 18 logger.LogDebug("After Request with Uri '{Uri}'", displayUrl); 19 }); 20 app.UseExceptionHandler(); builder.Services.AddDbContext(optionsBuilder => 1 { 2 optionsBuilder.UseSqlite("Data Source=app.db"); 3 }); 4 5 // .. 6 7 app.RegisterExpenseEndpoints(); 8 9 10 11 12 app.Use(async (context, next) => 13 { 14 var logger = app.Logger; 15 var displayUrl = context.Request.GetDisplayUrl(); 16 logger.LogDebug("Before Request with Uri '{Uri}'", displayUrl); 17 await next(context); 18 logger.LogDebug("After Request with Uri '{Uri}'", displayUrl); 19 }); 20 app.Use(async (context, next) => { var logger = app.Logger; var displayUrl = context.Request.GetDisplayUrl(); logger.LogDebug("Before Request with Uri '{Uri}'", displayUrl); await next(context); logger.LogDebug("After Request with Uri '{Uri}'", displayUrl); }); builder.Services.AddDbContext(optionsBuilder => 1 { 2 optionsBuilder.UseSqlite("Data Source=app.db"); 3 }); 4 5 // .. 6 7 app.RegisterExpenseEndpoints(); 8 9 10 app.UseExceptionHandler(); 11 12 13 14 15 16 17 18 19 20 app.RegisterExpenseEndpoints(); builder.Services.AddDbContext(optionsBuilder => 1 { 2 optionsBuilder.UseSqlite("Data Source=app.db"); 3 }); 4 5 // .. 6 7 8 9 10 app.UseExceptionHandler(); 11 12 app.Use(async (context, next) => 13 { 14 var logger = app.Logger; 15 var displayUrl = context.Request.GetDisplayUrl(); 16 logger.LogDebug("Before Request with Uri '{Uri}'", displayUrl); 17 await next(context); 18 logger.LogDebug("After Request with Uri '{Uri}'", displayUrl); 19 }); 20

Slide 37

Slide 37 text

app.RegisterExpenseEndpoints(); public static void RegisterExpenseEndpoints(this IEndpointRouteBuilder endpoint) { var group = endpoint.MapGroup("/api/expenses"); group.MapGet("/", async (AppDbContext dbContext, int? page, int? pageSize) => { page ??= 0; pageSize ??= int.MaxValue; return await dbContext .Expenses .OrderBy(b => b.Id) .Skip(page.Value) .Take(pageSize.Value) .AsNoTracking() .ToListAsync(); }) .WithDescription("Retrieves all expenses."); } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

group.MapGet("/", async (ExpenseRepository repository, int? page, int? pageSize) => public static void RegisterExpenseEndpoints(this IEndpointRouteBuilder endpoint) 1 { 2 var group = endpoint.MapGroup("/api/expenses"); 3 4 5 { 6 page ??= 0; 7 pageSize ??= int.MaxValue; 8 9 return await repository.GetAllAsync(page, pageSize); 10 }) 11 .WithDescription("Retrieves all expenses."); 12 } 13 app.RegisterExpenseEndpoints();

Slide 40

Slide 40 text

group.MapGet("/", async (ExpenseRepository repository, int? page, int? pageSize) => public static void RegisterExpenseEndpoints(this IEndpointRouteBuilder endpoint) 1 { 2 var group = endpoint.MapGroup("/api/expenses"); 3 4 5 { 6 page ??= 0; 7 pageSize ??= int.MaxValue; 8 9 return await repository.GetAllAsync(page, pageSize); 10 }) 11 .WithDescription("Retrieves all expenses."); 12 } 13 return await repository.GetAllAsync(page, pageSize); public static void RegisterExpenseEndpoints(this IEndpointRouteBuilder endpoint) 1 { 2 var group = endpoint.MapGroup("/api/expenses"); 3 4 group.MapGet("/", async (ExpenseRepository repository, int? page, int? pageSize) => 5 { 6 page ??= 0; 7 pageSize ??= int.MaxValue; 8 9 10 }) 11 .WithDescription("Retrieves all expenses."); 12 } 13 app.RegisterExpenseEndpoints();

Slide 41

Slide 41 text

app.RegisterExpenseEndpoints(); return await repository.GetAllAsync(page, pageSize); public class ExpenseRepository { private readonly AppDbContext _dbContext; public ExpenseRepository(AppDbContext dbContext) => _dbContext = dbContext; public async Task> GetAllExpenses( int page, int pageSize) { return await _dbContext .Expenses .OrderBy(b => b.Id) .Skip(page) .Take(pageSize) .AsNoTracking() .ToListAsync(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

No content

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

nx g @nx/angular:library products --directory=modules/products --standalone

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

yarn add -D @nx-dotnet/core 1 2 nx g @nx-dotnet/core:init 3 4 nx g @nx-dotnet/core:app ExpenseAPI \ 5 --directory=apps/ExpenseAPI \ 6 --test-template xunit 7 8 nx serve AppsExpenseAPI.ExpenseAPI 9

Slide 76

Slide 76 text

yarn add -D @nx-dotnet/core 1 2 nx g @nx-dotnet/core:init 3 4 nx g @nx-dotnet/core:app ExpenseAPI \ 5 --directory=apps/ExpenseAPI \ 6 --test-template xunit 7 8 nx serve AppsExpenseAPI.ExpenseAPI 9 nx g @nx-dotnet/core:init yarn add -D @nx-dotnet/core 1 2 3 4 nx g @nx-dotnet/core:app ExpenseAPI \ 5 --directory=apps/ExpenseAPI \ 6 --test-template xunit 7 8 nx serve AppsExpenseAPI.ExpenseAPI 9

Slide 77

Slide 77 text

yarn add -D @nx-dotnet/core 1 2 nx g @nx-dotnet/core:init 3 4 nx g @nx-dotnet/core:app ExpenseAPI \ 5 --directory=apps/ExpenseAPI \ 6 --test-template xunit 7 8 nx serve AppsExpenseAPI.ExpenseAPI 9 nx g @nx-dotnet/core:init yarn add -D @nx-dotnet/core 1 2 3 4 nx g @nx-dotnet/core:app ExpenseAPI \ 5 --directory=apps/ExpenseAPI \ 6 --test-template xunit 7 8 nx serve AppsExpenseAPI.ExpenseAPI 9 nx g @nx-dotnet/core:app ExpenseAPI \ --directory=apps/ExpenseAPI \ --test-template xunit yarn add -D @nx-dotnet/core 1 2 nx g @nx-dotnet/core:init 3 4 5 6 7 8 nx serve AppsExpenseAPI.ExpenseAPI 9

Slide 78

Slide 78 text

yarn add -D @nx-dotnet/core 1 2 nx g @nx-dotnet/core:init 3 4 nx g @nx-dotnet/core:app ExpenseAPI \ 5 --directory=apps/ExpenseAPI \ 6 --test-template xunit 7 8 nx serve AppsExpenseAPI.ExpenseAPI 9 nx g @nx-dotnet/core:init yarn add -D @nx-dotnet/core 1 2 3 4 nx g @nx-dotnet/core:app ExpenseAPI \ 5 --directory=apps/ExpenseAPI \ 6 --test-template xunit 7 8 nx serve AppsExpenseAPI.ExpenseAPI 9 nx g @nx-dotnet/core:app ExpenseAPI \ --directory=apps/ExpenseAPI \ --test-template xunit yarn add -D @nx-dotnet/core 1 2 nx g @nx-dotnet/core:init 3 4 5 6 7 8 nx serve AppsExpenseAPI.ExpenseAPI 9 nx serve AppsExpenseAPI.ExpenseAPI yarn add -D @nx-dotnet/core 1 2 nx g @nx-dotnet/core:init 3 4 nx g @nx-dotnet/core:app ExpenseAPI \ 5 --directory=apps/ExpenseAPI \ 6 --test-template xunit 7 8 9

Slide 79

Slide 79 text

No content