You probably were trying to use ODataConventionModelBuilder
instead of ODataModelBuilder
. The convention builder would automatically create the link generating factories for you.
So, you can change the code like below:
var modelBuilder = new ODataConventionModelBuilder();
if you are curious as to how to create link factories yourself, you can check the following sample(specifically the file ODataServiceSample/ODataService/ModelBuilder.cs
):
http://aspnet.codeplex.com/sourcecontrol/latest#Samples/WebApi/ODataServiceSample/ReadMe.txt