Building High-Performance modules in DNN6 with C# 4.0, LINQ2Entities, and Visual Studio 2010
Last Post 01/05/2012 2:37 PM by Joseph Craig. 14 Replies.
Author Messages
Joakim Andersson
Nuke Newbie
Nuke Newbie
Posts:9


--
12/03/2011 1:47 PM
    Don't know if this is the right forum to post in, feel free to move it if it's wrong.

    When I come to Part 4 Implementing the Module I have a problem ~1m50s into the video where I should write
    var Model = Components.Data.Model.Model.Instance();
    var Data = (from x in Model.HTMLs where x.ModuleID == ModuleId select x).FirstOrdDefault();

    I can't get the Model.HTMLs. I also can't find where that HTMLs where implemented.
    First I thought it was cause I changed CompanyName to something else but I redid the tutorial and tried to follow exactly what you did but it's still the same problem.
    Joakim Andersson
    Nuke Newbie
    Nuke Newbie
    Posts:9


    --
    12/07/2011 7:49 AM
    Hello? Anyone?
    Has anyone else hade this problem with the tutorial or is it only me?
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    12/07/2011 1:53 PM
    Sorry, I just haven't had the time to check this out. I'll try to do that.

    Joe Craig, Patapsco Research Group
    Complete DNN Support
    Joakim Andersson
    Nuke Newbie
    Nuke Newbie
    Posts:9


    --
    12/08/2011 6:13 AM
    Thank you.
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    12/09/2011 6:03 AM
    Is Intellisense able to tell you which methods or attributes exist in Model? In other words, is the an HTMLs?

    Joe Craig, Patapsco Research Group
    Complete DNN Support
    Joakim Andersson
    Nuke Newbie
    Nuke Newbie
    Posts:9


    --
    12/09/2011 8:50 AM
    No there isn't a HTMLs
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    12/09/2011 8:54 AM
    It would seem that the model didn't get created correctly. (I'm guessing here, but you could open up the Model code and look at that.)

    Joe Craig, Patapsco Research Group
    Complete DNN Support
    Joakim Andersson
    Nuke Newbie
    Nuke Newbie
    Posts:9


    --
    12/09/2011 9:42 AM
    I used the code that followed with the video. I'll try again when I get home.

    Have you tried to follow the tutorial yourself from scratch?
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    12/09/2011 12:23 PM
    No, unfortunately I haven't had an opportunity to do that.

    Joe Craig, Patapsco Research Group
    Complete DNN Support
    Joakim Andersson
    Nuke Newbie
    Nuke Newbie
    Posts:9


    --
    12/10/2011 3:19 AM
    The only thing that is in the Model.cs is this

     
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    
    namespace CompanyName.BasicHTML.Components.Data.Model
    {
        public partial class Model
        {
            public static Model Instance()
            {
                var entityBuilder = new System.Data.EntityClient.EntityConnectionStringBuilder();
                entityBuilder.ProviderConnectionString = DotNetNuke.Common.Utilities.Config.GetConnectionString();
                entityBuilder.Metadata = "res://*/";
                entityBuilder.Provider = "System.Data.SqlClient";
                return new Model(entityBuilder.ToString());
            }
        }
    }
    

    And that is copied right from the model.cs that you provide from this site.

    Joakim Andersson
    Nuke Newbie
    Nuke Newbie
    Posts:9


    --
    12/17/2011 2:28 PM
    I'd really like to follow along with video 5 and 6.. can anyone help me sort this out?
    Joakim Andersson
    Nuke Newbie
    Nuke Newbie
    Posts:9


    --
    12/31/2011 3:59 PM
    Can someone please take the time to check this tutorial out?
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    01/02/2012 12:45 AM
    I have worked my way up to the point in Video 4 where you are having trouble. For me, there is no problem. So, let's try to figure out where your problem is located.

    First, are your website and your project both set for ASP.NET 4.0?

    I assume that the "var Model" line is ok. If so, can you do an intellisense search on Model to see what is there? So, change Model.HTMLs to Model, then type . and then see what appears in the intellisense list. In my version, the third entry is AddToHTMLs. What is the corresponding item in your module?

    Whatever comes after AddTo should also appear by itself in the list. In my case, I also have HTMLs in the list.


    Joe Craig, Patapsco Research Group
    Complete DNN Support
    Joakim Andersson
    Nuke Newbie
    Nuke Newbie
    Posts:9


    --
    01/05/2012 12:00 PM
    Yes both the website and the project is set for 4.0

    The third entry for me is AddToCompanyName_BasicHTML_HTML

    What version of Visual Studio are you using? I'm using visual studio 2010 Ultimate
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    01/05/2012 2:37 PM
    There was a step in the tutorial where Andy renamed the model to just a simple HTML. That is why he can later refer to Model.HTMLs.

    Since yours is still named AddToCompanyName_BasicHTML_HTML, then you should change that line to refer to Model.AddToCompanyName_BasicHTML_HTMLs.

    Note: You should have an entry AddToCompanyName_BasicHTML_HTML in the intellisense list.

    You other option is to go back and rename the model.


    Joe Craig, Patapsco Research Group
    Complete DNN Support


    ---