Linking Dynamo and c#

Hi,

I want to write a c# dll to use inside Dynamo.

In my c# code i need to use the current document from Dynamo

When i write:

Autodesk.Revit.DB.Document doc = Revit.Application.Document.Current;

i get an error “Error 5 Cannot implicitly convert type ‘Revit.Application.Document’ to 'Autodesk.Revit.DB.Document”

Please help how can i get the document converted?..

 

Mike