假设我在C#中有这个接口,并希望在F#中实现它
public interface IBatch
{
System.Data.IDbConnection Connection { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
我希望在F#中实现接口,但无法找出正确的语法.我有这样的事情:
type public Batch =
interface IBatch with
member f.Connection
with get() = new Devart.Data.Oracle.OracleConnection()
and set value = ()
Run Code Online (Sandbox Code Playgroud)
我得到的错误是:
此表达式应具有类型IDbConnection,但此处具有类型Devart.Data.Oracle.OracleConnection