Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kurniawan Kurniawan 202 posts 225 karma points
    Aug 19, 2010 @ 06:09
    Kurniawan Kurniawan
    0

    Document Types - Export To .NET

    In V4.5

    when right click on Document Types, you will find "Export to .NET" option.

    It will generate the POCO and abstraction.

    What this is used for ? When I saw the generated code, It seems similar with the abstraction for Linq to umbraco ?

    Anyone knows what is the idea behind this and the scenario when you want to use this ?

    Thanks

  • Richard Soeteman 3640 posts 11094 karma points MVP
    Aug 19, 2010 @ 08:01
    Richard Soeteman
    0

    Export to.net will generate a class so that you can use the doctype in LinqToUmbraco. Checkout this package to do this process automatically.

    Cheers,

    Richard 

  • Kurniawan Kurniawan 202 posts 225 karma points
    Aug 19, 2010 @ 08:27
    Kurniawan Kurniawan
    0

    Cool..

    any good link to learn linq2umbraco for V4.5 ?

     

    Thanks

  • Richard Soeteman 3640 posts 11094 karma points MVP
    Aug 19, 2010 @ 08:32
    Richard Soeteman
    0

    Wel there isn't a book but there is a WIKI and checkout the following blogs:

    http://www.aaron-powell.com/umbraco

    http://www.farmcode.org/post/2009/02/24/Linq-to-Umbraco.aspx

    Cheers,

    Richard

  • Aaron Powell 1708 posts 3043 karma points c-trib
    Aug 19, 2010 @ 10:42
    Aaron Powell
    0

    Richard - the LINQ to Umbraco stuff from farmcode is NOT v4.5 stuff, it's a custom framework we did for using LINQ with Umbraco 4.0

  • Kurniawan Kurniawan 202 posts 225 karma points
    Aug 20, 2010 @ 00:47
    Kurniawan Kurniawan
    0

    So right now on V4.5 umbraco.linq.dll.. can replace that custom framework on FarmCode ?

     

    Thanks

  • Duncan Fisher 13 posts 32 karma points
    Oct 06, 2010 @ 13:21
    Duncan Fisher
    0

    Hello,

    I've encountered a problem with the Export To .NET feature. Up until now it has worked great, but now when I go to export, I get the initial dialog and when I click "Create", I get an exception (see below). This seems to have happened since I was installing/uninstalling a couple of TreeMultiPicker packages (maybe some connection).

    Can anyone offer assistance on a fix, as this feature is invaluable in v4.5!

    Many thanks,

    Duncan.

    [KeyNotFoundException: The given key was not present in the dictionary.]
       System.ThrowHelper.ThrowKeyNotFoundException() +28
       System.Collections.Generic.Dictionary`2.get_Item(TKey key) +2645040
       umbraco.cms.businesslogic.datatype.controls.Factory.GetNewObject(Guid DataEditorId) +72
       umbraco.cms.businesslogic.datatype.controls.Factory.DataType(Guid DataTypeId) +63
       umbraco.cms.businesslogic.datatype.DataTypeDefinition.get_DataType() +108
       umbraco.presentation.umbraco.dialogs.ExportCode.GetDotNetType(PropertyType pt) +134
       umbraco.presentation.umbraco.dialogs.ExportCode.GenerateProperties(DocumentType dt) +577
       umbraco.presentation.umbraco.dialogs.ExportCode.GenerateClasses(Boolean includeInterfaces) +944
       umbraco.presentation.umbraco.dialogs.ExportCode.btnGenerate_Click(Object sender, EventArgs e) +554
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    

  • Aaron Powell 1708 posts 3043 karma points c-trib
    Oct 06, 2010 @ 23:46
    Aaron Powell
    0

    I think that's going to be caused by a property on a document having a property of a data type that doesn't exist anywhere.

    check to make sure they are all removed

  • Duncan Fisher 13 posts 32 karma points
    Oct 07, 2010 @ 11:23
    Duncan Fisher
    0

    Ok this seems to have resolved itself overnight. I must have removed the offending property without realising and it's now fixed!

    Thanks!

  • Mike Joseph 9 posts 29 karma points
    Oct 29, 2011 @ 19:39
    Mike Joseph
    0

    A video on Umbraco TV on how to use the LINQToUmbraco framework would be most welcome. I have spent hours trolling through blog posts and still can't seem to figure out how to get it working.

    It seems there are quite a few iterations of this package

    There was the custom implementation slace pointed out on Farm Code:
    http://www.farmcode.org/post/2009/02/24/Linq-to-Umbraco.aspx

    Then there's the wiki documentation, but the wiki implies that the code export utility generates classes, but when I look at the file generated, I only see interfaces. What do I do with these? Any help would or a point in the right direction would be GREATLY appreciated.

    Thanks!

  • Mike Joseph 9 posts 29 karma points
    Oct 29, 2011 @ 20:42
    Mike Joseph
    0

    Grrr... I found it... stupid me.  After a little trial and error, I think I've finally got it.

    The current code generating tool gives you two options... generate POCO or generate POCO with abstractions... I didn't really know what any of this meant and didn't realize there were two files to download, so I was only downloading and implementing the abstractions file (the interfaces I was referencing) and they weren't much use without the poco code. Once I added the POCO code file, it was all good.

    Also, for anyone else who's looking, I did find a linq (pun intended) to some training videos on the subject here: 
    http://aaron-powell.com/training-videos ;

    An another note, once I figured this all out, I was having troubles making the POCO file compile properly. The reason for this is because of how I was naming my Document Types. For example, I had a document type called "Event", which held information about an event (like one you would find on a calendar. Name, Location, Start Time, End Time, etc)... then I had another document type named "Events" which was meant to list multiple Event Documents which were subnodes. Anyway, I guess the code generation was also creating and Events class which did the same sort of thing using the iEnumerable stuff and got confused when it tried to create another Events class to represent the document type... longer short of it is that I just changed my "Events" document type to "Event Container" and that allowed to me to compile successfully.

    Now that I've finally gotten it working, it works GREAT!

    I think a quick down and dirty example on how to use this feature would be a valuable topic to cover on the official Umbraco TV site. Most of the programming I've done in the past has been LINQ-to-SQL based and the discovery of this framework is going to make my life much, much easier.

  • Silvan Egger 28 posts 200 karma points
    Jul 26, 2016 @ 09:58
    Silvan Egger
    0

    In v7.4.3 there's no such option like "Export to .NET". Did Umbraco remove this? I can only find the option "Export Document Type" when i rightclick on a Document Type. But with this option i'd have to do it with all Document Types seperately.

    Can anyone help me with this? Why was this removed?

  • Bijesh Tank 184 posts 411 karma points
    Jul 26, 2016 @ 10:52
    Bijesh Tank
    0

    Hi Silvan,

    This has been removed from Umbraco for a little while now. You may want to look at the new Models Builder introduced in Umbraco 7.4. Or you could look at something like Ditto

    B.

  • Aaron Powell 1708 posts 3043 karma points c-trib
    Jul 26, 2016 @ 11:01
    Aaron Powell
    0

    It was part of the LINQ to Umbraco implementation that was removed in v6 IIRC.

Please Sign in or register to post replies

Write your reply to:

Draft