2013-10-22 4 views
4

하자 내가 C#에서이 인터페이스를 가지고 있고이 F 번호의 인터페이스를 구현하고자하지만, 올바른 구문을 파악하지 못할 F 번호F # 인터페이스 구현

public interface IBatch 
{ 
    System.Data.IDbConnection Connection { get; set; } 
} 

에서 구현하고 싶은 말은.

type public Batch = 
    interface IBatch with 
     member f.Connection 
      with get() = new Devart.Data.Oracle.OracleConnection() 
      and set value =() 

내가지고있어 오류는 다음과 같습니다 : 여기

이 표현이 형 IDbConnection을이 예상되었지만 Devart.Data.Oracle.OracleConnection

답변

7

F 번호가 수행을 입력 한 나는 이런 식으로 뭔가를 C#처럼 암시 적 다운 캐스팅을 구현하지 않아야합니다.

type public Batch = 
    interface IBatch with 
     member f.Connection 
      with get() = new Devart.Data.Oracle.OracleConnection() :> System.Data.IDbConnection 
      and set value =() 
+0

아. 내가 놓친 간단한 구문의 세부 사항임을 알았습니다. 감사! 10 분 안에 답을 수락합니다. – Filip