Skip to content

2020. 12. 21 12시 - 오늘의 벽돌 #1

@D-Gun

Description

@D-Gun

람다식

  • 람다식은 함수를 좀 더 간결하게 표현하기 위해 작성되어진다.
  • 주로 함수가 1~2줄 이내로 작성 가능할때 사용하면 유용하다.
  • 표현 방식은 구문과 식 두가지로 나뉜다.
//queryTime = queryTime.Where(x => (x.date.Year == selectedYear) && (x.stationId == stationNumber)); 의 구문에서
//람다식 으로 표현된 x => (x.date.Year == SelectedYear) 는 아래처럼 풀어 쓸 수 있다.
        private bool ramda(FootTrafficMonthlyTotalModel queryTime)
        {
            if (queryTime.date.Year = selectedyear) return true;
            return false;
        }

잊지말자.
오늘 마주한 벽 앞에서 빼넨 벽돌 하나는 내일 내가 만날 벽의 높이를 낮춘다.

Metadata

Metadata

Assignees

Labels

BrickThis doesn't seem right

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions