Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Modern WebAPIS with ASP.NET Core
Search
Fabian Gosebrink
June 25, 2018
Technology
140
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Modern WebAPIS with ASP.NET Core
Slides for my talk at the DWX 2018 in Nürnberg "Modern WebAPIs with ASP.NET Core"
Fabian Gosebrink
June 25, 2018
More Decks by Fabian Gosebrink
See All by Fabian Gosebrink
Why State Is the Most Important Part of Your Angular Application
fabiangosebrink
0
45
Scalable Angular Architectures with Route-Based Architecture
fabiangosebrink
0
36
Advanced Signal Store: Structuring State for Real Angular Applications
fabiangosebrink
0
130
NgRx Signal Store - A Deeper Dive
fabiangosebrink
0
85
Modern Angular Apps in 2026
fabiangosebrink
0
150
Why State is the Most Important Part of Your Angular Application
fabiangosebrink
0
170
Angular testing made easy with Jest and Cypress
fabiangosebrink
0
190
Introducing state management into an application with NgRx
fabiangosebrink
0
280
Scalable architectures in Angular with Nx
fabiangosebrink
0
280
Other Decks in Technology
See All in Technology
Local CI × GitHub Actions
gogutan
2
190
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
130
サブエージェントと Claude Mods で作る独自 Advisor ツールの話
kenichiodo
2
160
AIカンパニーへの転換を支えた、エンジニアの仕事の再定義
kworkdev
PRO
2
1.2k
Kiro Crewをはじめよう
kizawa2020
1
160
JAWS-UGグッズ職人仕事の流儀
kentapapa
0
100
OptunaHub: ブラックボックス最適化のためのプラットフォーム
pfn
PRO
0
140
Code for Security プロジェクト紹介 2026年10月
yu23ki14
0
110
触りたくないデータに、どう触るか AI時代のRBACアクセスガバナンス
ivry_presentationmaterials
0
260
今さら理解するウェブフォントver.2026
takanorip
3
770
AI駆動開発の時代になったのでトヨタ生産方式から見直す
terurou
7
6k
しろおびから始める!ログ活用の第一歩
shumei_ito
0
950
Featured
See All Featured
From π to Pie charts
rasagy
1
400
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
820
Crafting Experiences
bethany
1
380
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
Designing for Timeless Needs
cassininazir
1
530
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
950
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
620
Music & Morning Musume
bryan
48
7.4k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Transcript
with Building modern WebAPIs ASP.NET Core
None
None
None
@FabianGosebrink
None
https://developer-academy.ch
with Building modern WebAPIs ASP.NET Core
What is ASP.NET Core?
MVC + WebAPI + Web Pages
None
Faster Deployment Cycles
None
Tooling
DOTNET CLI fabian gosebrink
class Program { static void Main(string[] args) { Console.WriteLine("Hello World!");
} }
DOTNET CLI fabian gosebrink
Program.cs 1. public class Program 2. { 3. public static
void Main(string[] args) 4. { 5. CreateWebHostBuilder(args).Build().Run(); 6. } 7. 8. public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 9. WebHost.CreateDefaultBuilder(args) 10. .UseStartup<Startup>(); 11. }
public static IWebHostBuilder CreateDefaultBuilder(string[] args) { var builder = new
WebHostBuilder(); builder.UseKestrel(...) .ConfigureAppConfiguration((hostingContext, config) => { config.AddJsonFile( "appsettings.json", optional: true, reloadOnChange: true); }) .ConfigureLogging((hostingContext, logging) => { logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); logging.AddConsole(); logging.AddDebug(); }) .ConfigureServices((hostingContext, services) => { //... }) .UseIISIntegration(); return builder; }
Dependency Injection
Startup.cs 1. public class Startup 2. { 3. public Startup(IConfiguration
configuration) 4. { 5. Configuration = configuration; 6. } 7. 8. public IConfiguration Configuration { get; } 9. 10. public void ConfigureServices(IServiceCollection services) 11. { 12. services.AddOptions(); 13. 14. services.AddCors(...); 15.
Kestrel
None
REST
What is Rest?
Rest is not WebAPI
Rest is not HTTP
None
Architectural Style
GET /api/orders/ GET /api/orders/1 POST /api/orders/ PUT /api/orders/1 DELETE /api/orders/1
Rest Constraints
Richardson Maturity Model
STATUSCODES
export const isSuccess = (status): boolean => (status >= 200
&& status < 300)
2xx
4xx
5xx
The Controller 1. [Route("api/[controller]")] 2. public class FoodController : Controller
3. { 4. private readonly IFoodRepository _foodRepository; 5. 6. public FoodController(IFoodRepository foodRepository) 7. { 8. _foodRepository = foodRepository; 9. } 10. 11. [HttpGet] 12. public ActionResult<List<FoodItemDto>> Get() 13. { 14. ICollection<FoodItem> foodItems = _foodRepository.GetAll(); 15. IEnumerable<FoodItemDto> dtos = foodItems 16. .Select(x => Mapper.Map<FoodItemDto>(x)); 17. 18. return Ok(dtos);
Documentation
Documentation
None
VERSIONING
document.docx
document- nal.docx
document- nal- nal.docx
document-really- nal.docx
document-really- nal-end- of-discussion.docx
document-really- nal- approved-by- customer.docx
document-really- nal- approved-by-customer- with-alterations- suggested-by-his- assistant.docx
document-really- nal-approved- by-customer-with-alterations- suggested-by-his-assistant-and- his-friend-cause-apparently-he- thinks-he-knows-all-about-good- api-design
document-really- nal-approved- by-customer-with-alterations- suggested-by-his-assistant-and- his-friend-cause-apparently-he- thinks-he-knows-all-about-good- api-design.docx
None
None
DEMO
/api/houses?page=4&pageSize=10
/api/houses?orderby=Id
/api/houses?fields=street,number
HATEOAS
{ "departmentId": 10, "departmentName": "Administration", "locationId": 1700, "managerId": 200, "links":
[ { "href": "10/employees", "rel": "employees", "type" : "GET" } ] }
SignalR
None
None
None
Le Fin
@FabianGosebrink https://offering.solutions/
[email protected]
https://github.com/FabianGosebrink https://github.com/FabianGosebrink/ASPNETCore- WebAPI-Sample
Resources https://media.giphy.com/media/1BXa2alBjrCXC/giphy.gif http://img0.joyreactor.com/pics/post/photo-india-it-programmer-548432.jpeg