본문 바로가기
728x90
반응형

ASP.NET Core47

.NET 6] Minimal APIs VS MVC APIs 차이점 출처 : https://www.youtube.com/watch?v=5YB49OEmbbE&t=5254s Minimal API란? controller를 사용하지 않고, mvc framework를 사용하지도 않는다. ASP.NET Core에서 최소한의 파일만 포함하는 microservices 와 app을 위한 개념이다. Minimal APIs 과 MVC APIs의 차이점: model validation을 제공하지 않는다. JSONPatch를 제공하지 않는다. filters를 제공하지 않는다. Custom model binding을 제공하지 않는다. Minimal APIs vs MVC APIs : API 함수 추가하는 방식의 차이를 알아보자. MVC API : Controller 파일에 api 함수를 추가한다... 2022. 6. 15.
.NET 6] SignalR Server, SignalR Client App 출처 : https://dotnetplaybook.com/which-is-best-websockets-or-signalr/ Http, XMLHttpRequest & WebSockets 개념 Http Request / Response Cycle 동기 Synchronous Stateless : 요청하고 응답받고의 반복이며, 어떠한 연결을 유지하거나 상태값을 관리하지 않는다. XMLHttpRequest (Ajax) 부분 UI 업데이트가 가능하다. 비동기 Asynchronous Long Polling에서 사용된다. WebSockets Http "upgrade" 요청으로 시작한다. 양방향 통신이 가능하다. Bi-directional Server와 Client의 연결이 유지된다. Persistent WebSocke.. 2022. 6. 9.
.NET Core] Request Pipeline - Run, Map, Use .NET Core 어플리케이션은 Program.cs 파일에 어플리케이션 시작 코드를 포함한다. Program.cs 구성요소 1. 서비스 추가 2. HTTP Request Pipeline 구성요소 Program.cs 소스 예시) var builder = WebApplication.CreateBuilder(args); // Add services to the container. //컨테이너에 서비스를 추가한다. //DI프레임워크가 런타임에 이 서비스의 인스턴스를 제공한다. builder.Services.AddRazorPages(); builder.Services.AddControllersWithViews(); var app = builder.Build(); // Configure the HTTP reques.. 2022. 5. 23.
.NET 6 API with Redis] 4. API using Hashes Data Type 출처 : https://dotnetplaybook.com/redis-as-a-primary-database/ 이제까지 Strings Data Type만 사용하여 api를 구현하였다. structure objects를 저장하는데 Strings보다는 Hashes가 더 알맞다. Strings 1 to 1 mapping between Key and Value Set using SET Returned using GET Hashes 1 to multiple mapping between Key and Field / Value pairs Stores Field / Value pairs Set using HMSET Get all items using HGETALL Get individual items using HGET.. 2022. 5. 18.
.NET 6 API with Redis] 3. Model , Repository, Controller구성 출처 : https://dotnetplaybook.com/redis-as-a-primary-database/ 1. Application architecture 2. Model Platform.cs using System.ComponentModel.DataAnnotations; namespace RedisAPI.Models { public class Platform { [Required] public string Id { get; set; } = $"platform:{Guid.NewGuid().ToString()}"; [Required] public string Name { get; set; } = string.Empty; } } 3. Repository IPlatformRepo.cs using Redis.. 2022. 5. 18.
.NET 6 API with Redis] 2. docker를 사용해서 redis 컨테이너 구성 출처 : https://dotnetplaybook.com/redis-as-a-primary-database/ 개발환경 : Visual Studio Code, .NET 6.0 SDK, Docker 1. VSCode에서 ASP.NET Core Web API 템플릿을 선택하여 프로젝트를 생성한다. redis를 docker를 사용해서 세팅해보자. window에서 docker 설치방법은 아래 글을 참조하자. https://bigexecution.tistory.com/122 Windows 10] Docker Desktop 설치 Docker Desktop이란? Docker Desktop은 윈도우나 맥 환경에서 컨테이너화된 어플리케이션 또는 microservice를 생성할 수 있도록 해주는 설치 어플리케이션이다. Do.. 2022. 5. 18.
728x90
반응형