다음을 통해 공유


정식 함수 매핑에 대한 CLR 메서드

Entity Framework에서는 문자열 조작 및 수식 함수와 같이 다수의 데이터베이스 시스템이 공통적으로 가지고 있는 기능을 구현하는 일련의 정식 함수를 제공합니다. 따라서 개발자는 다양한 데이터베이스 시스템을 대상으로 작업할 수 있습니다. 이러한 정식 함수는 LINQ to Entities와 같은 쿼리 기술에서 호출하면 사용 중인 공급자에 해당하는 올바른 저장소 함수로 변환됩니다. 그러면 함수 호출이 다양한 데이터 소스에서 공통적인 형태로 표현될 수 있으며, 따라서 다수의 데이터 소스에서 일관적인 쿼리를 사용할 수 있습니다. 피연산자가 숫자 형식인 경우 비트 AND, OR, NOT 및 XOR 연산자도 정식 함수에 매핑됩니다. 부울 피연산자의 경우 비트 AND, OR, NOT 및 XOR 연산자는 피연산자의 논리 AND, OR, NOT 및 XOR 연산을 컴퓨팅합니다. 자세한 내용은 정식 함수를 참조하세요.

LINQ 시나리오의 경우, Entity Framework에 대한 쿼리에서는 정식 함수를 통해 특정 CLR 메서드를 기본 데이터 소스에 대한 메서드에 매핑합니다. LINQ to Entities 쿼리의 메서드 호출이 정식 함수에 명시적으로 매핑되지 않는 경우 런타임에 NotSupportedException 예외가 throw됩니다.

System.String 메서드(정적) 매핑

System.String 메서드(정적) 정식 함수
System.String Concat(String str0, String str1)는 두 개의 문자열을 하나로 연결합니다. Concat(str0, str1)
System.String Concat(String str0, String str1, String str2) Concat(Concat(str0, str1), str2)
System.String Concat(String str0, String str1, String str2, String str03) Concat(Concat(Concat(str0, str1), str2), str3)
Boolean 같음(String a, String b) = 연산자
Boolean IsNullOrEmpty(String value) (IsNull(value)) 또는 Length(value) = 0
불리언 op_Equality(String a, String b) = 연산자
Boolean op_Inequality(String a , String b) != 연산자
Microsoft.VisualBasic.Strings.Trim(String str) Trim(str)
Microsoft.VisualBasic.Strings.LTrim(String str) Ltrim(str)
Microsoft.VisualBasic.Strings.RTrim(String str) - 이 함수는 문자열의 오른쪽 끝에서 공백을 제거합니다. Rtrim(str)
Microsoft.VisualBasic.Strings.Len(String expression) Length(expression)
Microsoft.VisualBasic.Strings.Left(String str, Int32 Length) 왼쪽(str, Length)
Microsoft.VisualBasic.Strings.Mid(String str, Int32 Start, Int32 Length) Substring(str, Start, Length)
Microsoft.VisualBasic.Strings.Right(String str, Int32 Length) 오른쪽(str, Length)
Microsoft.VisualBasic.Strings.UCase(String Value) ToUpper(Value)
Microsoft.VisualBasic.Strings.LCase(문자열 값) ToLower(Value)

System.String 메서드(인스턴스) 매핑

System.String 메서드(인스턴스) 정식 함수 주의
Boolean Contains(String value) this LIKE '%value%' value가 상수가 아니면 IndexOf(this, value) > 0에 매핑됩니다.
Boolean EndsWith(String value) this 좋아요 '%value' value가 상수가 아니면 Right(this, length(value)) = value에 매핑됩니다.
Boolean StartsWith(String value) this LIKE 'value%' value가 상수가 아니면 IndexOf(this, value) = 1에 매핑됩니다.
길이 Length(this)
Int32 IndexOf(문자열 value) IndexOf(this, value) - 1
System.String Insert(Int32 startIndex, String value) Concat(Concat(Substring(this, 1, startIndex), value), Substring(this, startIndex+1, Length(this) - startIndex))
String 클래스의 Remove 메서드(System.String Remove(Int32 startIndex))는 지정한 위치의 문자를 제거합니다. Substring(this, 1, startIndex)
시스템.문자열 제거(Int32 startIndex, Int32 count) Concat(Substring(this, 1, startIndex), Substring(this,startIndex + count +1, Length(this) - (startIndex + count))) Remove(startIndex, count)는 count가 0 이상의 정수인 경우에만 지원됩니다.
시스템.문자열 교체(문자열 oldValue, 문자열 newValue) 바꾸기(this, oldValue, newValue)
System.String Substring(Int32 startIndex) 부분문자열(this, startIndex + 1, 길이(this) - startIndex)
System.String Substring(Int32 startIndex, Int32 length) Substring(this, startIndex +1, length)
System.String ToLower() ToLower(this)
System.String ToUpper() ToUpper(this)
System.String Trim() Trim(this)
System.String TrimEnd(Char[] trimChars) (끝에서 공백 문자를 제거하는 메서드) RTrim(this)
System.String TrimStart(Char[]trimChars) LTrim(this)
Boolean Equals(String value) = 연산자

System.DateTime 메서드(정적) 매핑

System.DateTime 메서드(정적) 정식 함수 주의
Boolean Equals(날짜/시간 t1, 날짜/시간 t2) = 연산자
System.DateTime.Now CurrentDateTime()
System.DateTime.UtcNow CurrentUtcDateTime()
부울 op_Equality(DateTime d1, DateTime d2) = 연산자
부울 op_GreaterThan(DateTime t1, DateTime t2) > 연산자
부울 op_GreaterThanOrEqual(DateTime t1, DateTime t2) >= 연산자
불리언 op_Inequality(DateTime t1, DateTime t2) != 연산자
부울 op_LessThan(DateTime t1, DateTime t2) < 연산자
부울 op_LessThanOrEqual(DateTime t1, DateTime t2) <= 연산자
Microsoft.VisualBasic.DateAndTime.DatePart( _

ByVal Interval 를 DateInterval로, _

ByVal DateValue As DateTime, _

선택적 ByVal FirstDayOfWeekValue As FirstDayOfWeek = VbSunday, _

선택적 ByVal FirstWeekOfYearValue As FirstWeekOfYear = VbFirstJan1 _

) 정수로
자세한 내용은 DatePart 함수 단원을 참조하세요.
Microsoft.VisualBasic.DateAndTime.Now CurrentDateTime()
Microsoft.VisualBasic.DateAndTime.Year(DateTime TimeValue) Year()
Microsoft.VisualBasic.DateAndTime.Month(DateTime TimeValue) 월()
Microsoft.VisualBasic.DateAndTime.Day(DateTime TimeValue) Day()
Microsoft.VisualBasic.DateAndTime.Hour(DateTime TimeValue) 시간()
Microsoft.VisualBasic.DateAndTime.Minute(DateTime TimeValue) 분()
Microsoft.VisualBasic.DateAndTime.Second(DateTime TimeValue) Second()

System.DateTime 메서드(인스턴스) 매핑

System.DateTime 메서드(인스턴스) 정식 함수
Boolean 동일함(DateTime value) = 연산자
요일 Day(this)
한 시간 시간(this)
밀리초 Millisecond(this)
분(this)
월(this)
두 번째 초(this)
연도 연도(this)

System.DateTimeOffset 메서드(인스턴스) 매핑

나열된 속성의 get 메서드에 대한 매핑이 나와 있습니다.

System.DateTimeOffset 메서드(인스턴스) 정식 함수 주의
요일 Day(this) SQL Server 2005에 대해서는 지원되지 않습니다.
한 시간 시간(this) SQL Server 2005에 대해서는 지원되지 않습니다.
밀리초 Millisecond(this) SQL Server 2005에 대해서는 지원되지 않습니다.
분(this) SQL Server 2005에 대해서는 지원되지 않습니다.
월(this) SQL Server 2005에 대해서는 지원되지 않습니다.
두 번째 초(this) SQL Server 2005에 대해서는 지원되지 않습니다.
연도 연도(this) SQL Server 2005에 대해서는 지원되지 않습니다.

참고 항목

Equals 메서드는 비교된 true 개체가 같으면 DateTimeOffset를 반환하고, 그렇지 않으면 false를 반환합니다. CompareTo 메서드는 비교된 DateTimeOffset 개체가 같으면 0을 반환하고, 크면 1을 반환하고, 작으면 -1을 반환합니다.

System.DateTimeOffset ( )

나열된 속성의 get 메서드에 대한 매핑이 나와 있습니다.

System.DateTimeOffset ( ) 정식 함수 주의
System.DateTimeOffset.Now() CurrentDateTimeOffset() SQL Server 2005에 대해서는 지원되지 않습니다.

System.TimeSpan ( )

나열된 속성의 get 메서드에 대한 매핑이 나와 있습니다.

System.TimeSpan 메서드(인스턴스) 정식 함수 주의
시간 단위 시간(this) SQL Server 2005에 대해서는 지원되지 않습니다.
밀리초 Millisecond(this) SQL Server 2005에 대해서는 지원되지 않습니다.
분(this) SQL Server 2005에 대해서는 지원되지 않습니다.
초(this) SQL Server 2005에 대해서는 지원되지 않습니다.

참고 항목

Equals 메서드는 비교된 true 개체가 같으면 TimeSpan를 반환하고, 그렇지 않으면 false를 반환합니다. CompareTo 메서드는 비교된 TimeSpan 개체가 같으면 0을 반환하고, 크면 1을 반환하고, 작으면 -1을 반환합니다.

DatePart 함수

DatePart 함수는 Interval의 값에 따라 다양한 정식 함수 중 하나에 매핑됩니다. 다음 표에서는 지원되는 Interval 값에 대한 정식 함수 매핑을 보여 줍니다.

간격 값 정식 함수
데이트인터벌.연도 Year() (년도 함수)
날짜 간격.월 월()
DateInterval.일 Day()
DateInterval.시간 시간()
날짜 간격.분 분()
DateInterval.Second (초 단위의 시간 간격) Second()

수치 연산 함수 매핑

CLR 메서드 정식 함수
System.Decimal.Ceiling(Decimal d) 천장(d)
System.Decimal.Floor(Decimal d) 면적(d)
System.Decimal.Round(Decimal d) Round(d)
System.Math.Ceiling(십진수 d) 천장(d)
System.Math.Floor(Decimal d) 면적(d)
System.Math.Round(Decimal d) Round(d)
System.Math.Ceiling(Double a) - 주어진 값보다 큰 최소의 정수를 반환하는 메소드 Ceiling(a)
System.Math.Floor(Double a) 면적(a)
System.Math.Round(Double a) Round(a)
System.Math.Round(더블 값, Int16 자리수) Round(값, 자릿수)
System.Math.Round(Double value, Int32 digits) Round(값, 자릿수)
System.Math.Round(10진수 값, 16비트 정수 자리 수) Round(값, 자릿수)
System.Math.Round(10진수 값, Int32 데이터 유형, 자릿수) Round(값, 자릿수)
System.Math.Abs(Int16 value) Abs(value)
System.Math.Abs(Int32 value) Abs(value)
System.Math.Abs(Int64 value) Abs(value)
System.Math.Abs(바이트 값) Abs(value)
System.Math.Abs(단일 값) Abs(value)
절대값을 구하는 함수: System.Math.Abs(Double value) Abs(value)
System.Math.Abs(10진수 값) Abs(value)
System.Math.Truncate(더블 값, 16비트 숫자) Truncate(값, 자릿수)
System.Math.Truncate(Double value, Int32 digits) 잘라내기(value, digits)
System.Math.Truncate(10진수 값, Int16 숫자) 값 절단(값, 자릿수)
System.Math.Truncate(Decimal value, Int32 digits) 잘라내기(value, digits)
System.Math.Power(Int32 value, Int64 지수) 거듭제곱(값, 지수)
System.Math.Power(Int32 value, Double exponent) 거듭제곱(값, 지수)
System.Math.Power(Int32 value, Decimal 지수) 거듭제곱(값, 지수)
System.Math.Power(Int64 value, Int64 지수) 거듭제곱(값, 지수)
System.Math.Power(Int64 value, Double exponent) 거듭제곱(값, 지수)
System.Math.Power(Int64 값, Decimal 지수) 거듭제곱(값, 지수)
System.Math.Power(Double value, Int64 지수) 거듭제곱(값, 지수)
System.Math.Power(Double value, Double 지수) 거듭제곱(값, 지수)
System.Math.Power(더블 값, 소수 지수) 거듭제곱(값, 지수)
System.Math.Power(10진수 값, Int64 지수) 거듭제곱(값, 지수)
System.Math.Power(10진수 값, 이중 지수) 거듭제곱(값, 지수)
System.Math.Power(10진수 값, 10진수 지수) 거듭제곱(값, 지수)

비트 연산자 매핑

비트 연산자 부울이 아닌 피연산자에 대한 정식 함수 부울 피연산자에 대한 정식 함수
비트 AND 연산자 비트와이즈앤드 op1 그리고 op2
비트 OR 연산자 BitWiseOr op1 또는 op2
비트 NOT 연산자 BitWiseNot NOT(op)
비트 XOR 연산자 BitWiseXor ((op1 AND NOT(op2)) OR (NOT(op1) AND op2))

기타 매핑

메서드 정식 함수
Guid.NewGuid() NewGuid()

참고 항목