Hello,
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
ddlParentCategory.DataBind()
Here is the controller code:
Public Function Get_Categories_By_Hierarchy(ByVal _PortalId As Integer) As IEnumerable(Of vw_Category_Hierarchy)
Try
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)
End Using
Return ret
Catch ex As Exception
Exceptions.LogException(ex)
Return Nothing
End Try
End Function
Here is the sql views peta poco class:
<TableName("vw_Category_Hierarchy")> _
<PrimaryKey("CategoryID", AutoIncrement:=False)> _
<Cacheable("Category_Hierarchy", CacheItemPriority.Default, 20)> _
<Scope("PortalId")>
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
End Class
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
jordan