這裏的接口是我的C#接口:實現在F#
public interface ITemplateService
{
string RenderTemplate(object model, string templateName);
string RenderTemplate(object model, string templateName, string directory);
}
我試圖在F#的實現,但得到的關鍵字end
錯誤。 (在執行文件中意外的end
)
module TemplateService
open DotLiquid
type TemplateService =
inherit ITemplateService
member this.RenderTemplate model (templateName:string):string = ""
member this.RenderTemplate model (templateName:string, directory:string):string = ""
end//error here.
ps。 F#中的這段代碼是什麼:
Template template = Template.Parse(stringToTemplate);
template.Render(Hash.FromAnonymousObject(model));
的「F#基礎」這裏http://msdn.microsoft.com/en-us/fsharp/cc835246標籤有一些很好的語法鏈接。 – Brian 2011-03-15 06:06:17