Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Cross Platform WebAPIs with ASP.NET Core
Search
Fabian Gosebrink
October 22, 2017
Technology
0
69
Cross Platform WebAPIs with ASP.NET Core
Slides for my talk about Cross Platform WebAPIs with ASP.NET Core
Fabian Gosebrink
October 22, 2017
Tweet
Share
More Decks by Fabian Gosebrink
See All by Fabian Gosebrink
Angular Architectures with NgRx Stores & Effects
fabiangosebrink
0
64
Angular Testing made easy with Jest and Cypress
fabiangosebrink
0
67
From Desktop to web and back
fabiangosebrink
0
17
Better Angular Architectures with Libraries and Nx
fabiangosebrink
0
240
Developing forms and validation with Typed Angular Reactive Forms
fabiangosebrink
0
46
Angular Testing made easy with Jest and Cypress
fabiangosebrink
0
56
Monorepos with Angular and Nx
fabiangosebrink
0
120
Create modern Web Apps with the new Angular and it's ecosystem
fabiangosebrink
0
76
Realtime Cross Platform Apps with Angular, ASP.NET Core and SignalR
fabiangosebrink
0
120
Other Decks in Technology
See All in Technology
Janus
bkuhlmann
1
490
Amplify Gen2を 拡張してみよう JAWS-UG北陸新幹線 ( 福井開催 ) 2024-04-06/Let's extend Amplify Gen2
fossamagna
0
280
AIQ株式会社 エンジニア向け会社紹介資料
aiqlab
0
360
〜小さく始めて大きく育てる〜データ分析基盤の開発から活用まで
kniino
0
2k
プロデザ! BY リクルート vol.18_リクルートのリサーチ実践組織「リサーチブーストコミュニティ」
recruitengineers
PRO
3
240
エンタープライズ環境下での Active Directory の運用 TIPS
tamaiyutaro
1
1.5k
人間の尊厳、幸福、アクセシビリティ / 第116回「WEB TOUCH MEETING」アクセシビリティSP
nulabinc
PRO
2
180
Autonomous Database Cloud 技術詳細 / adb-s_technical_detail_jp
oracle4engineer
PRO
14
35k
最近たまに見かけるTiDBってなんだ? - Findy
pingcap0315
2
540
少数チームで挑む: SwiftUI, TCA, KMPを用いた 新規動画配信アプリ 「ABEMA Live」の開発について
tomu28
0
530
長期間TiDBを使ってきた話 @ 私たちはなぜNewSQLを使うのかTiDB選定5社が語る選定理由と活用LT / Experiences with TiDB Over Time
chibiegg
2
650
入社後初めてのタスクでk8sアップグレードした話.pdf
kkato1
1
380
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
237
11k
Building a Modern Day E-commerce SEO Strategy
aleyda
16
6.3k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
226
16k
Unsuck your backbone
ammeep
662
57k
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
124
32k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
658
120k
Debugging Ruby Performance
tmm1
70
11k
Writing Fast Ruby
sferik
620
60k
Typedesign – Prime Four
hannesfritz
36
2k
The Illustrated Children's Guide to Kubernetes
chrisshort
29
46k
Git: the NoSQL Database
bkeepers
PRO
422
63k
Transcript
None
with Cross Platform WebAPIs ASP.NET Core
None
None
@FabianGosebrink
None
What is ASP.NET Core?
MVC + WebAPI + Web Pages ASP.NET Core
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
public class Program { public static void Main(string[] args) {
BuildWebHost(args).Run(); } public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>() .Build(); }
Program.cs 1. public class Program 2. { 3. public static
void Main(string[] args) 4. { 5. BuildWebHost(args).Run(); 6. } 7. 8. public static IWebHost BuildWebHost(string[] args) => 9. WebHost.CreateDefaultBuilder(args) 10. .UseStartup<Startup>() 11. .Build(); 12. }
public class Program { public static void Main(string[] args) {
var host = new WebHostBuilder() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseStartup<Startup>() .Build(); host.Run(); } }
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; set; } 9. 10. public void ConfigureServices(IServiceCollection services) 11. { 12. services.AddOptions(); 13. services.AddCors(...); 14. 15. services.AddSingleton<IFoodRepository, FoodRepository>();
Kestrel
None
REST
What is Rest?
Rest is not WebAPI
Rest is not HTTP
None
Architectural Style
Rest Constraints
Richardson Maturity Model
None
STATUSCODES
2XX
4XX
5XX
GET /api/orders/ GET /api/orders/1 POST /api/orders/ PUT /api/orders/1
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 IActionResult Get() 13. { 14. ICollection<FoodItem> foodItems = _foodRepository.GetAll(); 15. IEnumerable<FoodItemDto> dtos = foodItems
Documentation SWAGGER
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-wife- cause-apparently-she- thinks-she-knows-all- about-good-api-design
document-really- nal- approved-by-customer- with-alterations- suggested-by-his- assistant-and-his-wife- cause-apparently-she- thinks-she-knows-all-
None
API-VERSION: 2.0 /API/V2/HOUSES
DEMO
/api/houses?page=4&pageSize=10
/api/houses?orderby=Id
/api/houses?fields=street,number
SignalR
None
None
None
Le Fin
@FabianGosebrink https://swissangular.com https://github.com/FabianGosebrink https://github.com/FabianGosebrink/AS WebAPI-Sample
Resources https://www.thefamouspeople.com/pro les/images/og-donald_trump_ ag.jpg https://timedotcom. les.wordpress.com/2017/07/gettyimages-810247620.jpg?w=720&quality=85 https://media.giphy.com/media/xUPOqFfyBzvODVNTNu/giphy.gif https://cdn.vox- cdn.com/thumbor/5BOvGGpVyW4hSPLTAEYvHng6JlQ=/0x0:2931x1649/1200x800/ lters:focal(1239x265:1707x733)/c
cdn.com/uploads/chorus_image/image/55610995/GettyImages_810247620.0.jpg https://media.giphy.com/media/1BXa2alBjrCXC/giphy.gif http://img0.joyreactor.com/pics/post/photo-india-it-programmer-548432.jpeg