본문 바로가기

반응형

분류 전체보기

(511)
.NET - CORS For safety reasons, browsers, by default, do not allow access to servers with different domains. However, when in development this feature can be a pain in the ass. In this writing, we will see how we can negate this feature by adding allowing CORS option to the header of a request. Implementation Adding the Service Go to the Program.cs file, add the Cors service as shown below builder.Services...
브라우저 접근 허용하기 브라우저가 서버에 접근하기 위해서는 CORS라는 헤더를 통해 해당 브라우저의 접근이 허용되어야 합니다. CORS 헤더를 추가하는 방법을 볼까요? 구현하기 서비스 추가 Program.cs 파일에 아래 서비스를 추가합니다. builder.Services.AddCors(opt => { opt.AddPolicy("Cors", policy => { policy.AllowAnyHeader().AllowAnyMethod().WithOrigins("frontAddress"); }); }); 미들웨어 추가 Program.cs 파일 'app.UseAuthorization();' 위에 설정한 서비스를 사용하는 미들웨어를 등록합니다 app.UseCors("Cors"); 실행 작업이 완료되면 API 폴더로 이동하여 cd /AP..
Generic Repository Specification Pattern - Adding Searching One of the drawbacks about using the specification pattern is that we lose some of the functions provided by Entity Framework. Searching is one of them and we will see how we can manually create the feature with the specification pattern. Creating a Generic Repository Pattern Relational DB - Getting Data including Data from Other Entities (Generic Repository Pattern) Let's see how we can get dat..
지네릭 레포지토리 스페시피케이션 패턴 - 검색기능 추가하기 스페시피케이션 패턴의 단점 중 하나는 콘텍스트에서 기본제공하는 기능의 일부를 사용할 수 없다는 점입니다. 스페시피케이션 패턴에 검색기능을 추가하는 방법을 보겠습니다. 지네릭 레포지토리 패턴 설정하기 관계형 데이터 불러오기 (참조 데이터 포함) - 지네릭 레포지토리 패턴 엔티티프레임워크를 사용하여 관계형 테이블에서 참조하는 데이터를 포함하여 데이터를 불러오는 방법을 보겠습니다. 구현하기 애플리케이션 생성 .NET web-API 생성하기 개발도구 설치하기 .NET jin-co.tistory.com 스페시피케이션 폴더에 검색 쿼리를 처리할 클래스를 생성 아래 속성을 추가합니다 private string _search; public string Search{ get => _search ; set => _sear..
Generic Repository Specification Pattern - Adding Pagination One of the drawbacks about using the specification pattern is that we lose some of the functions provided by Entity Framework. Pagination is one of them and we will see how we can manually create the feature with the specification pattern. Creating a Generic Repository Pattern Relational DB - Getting Data including Data from Other Entities (Generic Repository Pattern) Let's see how we can get da..
지네릭 레포지토리 스페시피케이션 패턴 - 페이지네이션 추가하기 스페시피케이션 패턴의 단점 중 하나는 콘텍스트에서 기본제공하는 기능의 일부를 사용할 수 없다는 점입니다. 스페시피케이션 패턴에 페이지네이션 기능을 추가하는 방법을 보겠습니다. 지네릭 레포지토리 패턴 설정하기 관계형 데이터 불러오기 (참조 데이터 포함) - 지네릭 레포지토리 패턴 엔티티프레임워크를 사용하여 관계형 테이블에서 참조하는 데이터를 포함하여 데이터를 불러오는 방법을 보겠습니다. 구현하기 애플리케이션 생성 .NET web-API 생성하기 개발도구 설치하기 .NET jin-co.tistory.com 스페시피케이션 인터페이스에 정렬을 위한 메서드를 추가 int Take { get; } int Skip { get; } bool IsPagingEnabled { get; } 스페시피케이션 클래스로 이동하여 ..
Generic Repository Specification Pattern - Adding Filtering One of the drawbacks about using the specification pattern is that we lose some of the functions provided by Entity Framework. Filtering the result is one of them and we will see how we can manually create the feature with the specification pattern. Creating a Generic Repository Pattern Relational DB - Getting Data including Data from Other Entities (Generic Repository Pattern) Let's see how we ..
지네릭 레포지토리 스페시피케이션 패턴 - 필터링기능 추가하기 스페시피케이션 패턴의 단점 중 하나는 콘텍스트에서 기보제공하는 기능의 일부를 사용할 수 없다는 점입니다. 스페시피케이션 패턴에 필터링기능을 추가하는 방법을 보겠습니다. 지네릭 레포지토리 패턴 설정하기 관계형 데이터 불러오기 (참조 데이터 포함) - 지네릭 레포지토리 패턴 엔티티프레임워크를 사용하여 관계형 테이블에서 참조하는 데이터를 포함하여 데이터를 불러오는 방법을 보겠습니다. 구현하기 애플리케이션 생성 .NET web-API 생성하기 개발도구 설치하기 .NET jin-co.tistory.com 코어 프로젝트에 아이템 리스트를 가져오는 메서드에 필터링에 사용될 매개변수 (보기에서 'targetId'와 'typeId')를 옵션을 추가하고 베이스 스페시피케이션의 Where구문을 활용하는 베이스를 추가합니다 ..

728x90