I am using the new Dal2 for the business layer in a module I am developing. The problem I am facing is a difference in results between my test environment (dnndev.me) and my live site, which are both DNN 7.3.4 platform edition. In my test environment the results return as expected. In the live site there is some code that gets records from the repository and then dataBinds them to a dropdownlist. This dropdownlist remains empty even when the cache is cleared.
Here is how I get the records in the page load event of my module control:
Dim ctrlViews As New ViewsController
Dim AllCategories As IEnumerable(Of vw_Category_Hierarchy) = ctrlViews.Get_Categories_By_Hierarchy(Me.PortalId)
ddlParentCategory.DataSource = AllCategories
Here is the controller code:
Public Function Get_Categories_By_Hierarchy(ByVal _PortalId As Integer) As IEnumerable(Of vw_Category_Hierarchy)
Dim ret As IEnumerable(Of vw_Category_Hierarchy)
Using ctx As IDataContext = DataContext.Instance()
Dim rep As IRepository(Of vw_Category_Hierarchy) = ctx.GetRepository(Of vw_Category_Hierarchy)()
ret = rep.Get(_PortalId) '.OrderBy(Function(c) c.FullName)
Catch ex As Exception
Here is the sql views peta poco class:
<PrimaryKey("CategoryID", AutoIncrement:=False)> _
<Cacheable("Category_Hierarchy", CacheItemPriority.Default, 20)> _
Public Class vw_Category_Hierarchy
Public Property PortalId As Integer
Public Property CategoryID As Integer
Public Property FullName As String
Public Property CategoryLevel As Integer
Even if i set the cache timeout to 0 the records never appear in the drop down.
The code behind of other pages is working so I don't think it is a namespace issue and there are no errors shown or logged in the event viewer and a try catch with logging wraps all the code in question.
Can someone help me figure out why this works in my test installation but not in my live installation.
thanks in advance