Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesDAL2 DebuggingDAL2 Debugging
Previous
 
Next
New Post
3/27/2014 5:30 PM
 

I have a really simple think I'm trying to do to migrate some old DAL code to DAL2, slightly complicated by converting to C# at the same time. This first step should have been a piece of cake and I've hit a wall. All I want to do (for now) is query a view and display it in a datalist. Created a new project with the latest Christoc template, duplicated the View.* and item.cs and itemcontroller.cs, updated the manifest, and updated the view.ascx.cs to use the field names in the datalist. I made the model and controller to match the view, and the controller only does a GetAll since that's all I need (for now). I had to define a primary key on the decoration and return a portalid to get the caching to work, but now I get no errors, no records. I can find no real info on how to debug what's wrong. So my model has:  

I have a really simple think I'm trying to do to migrate some old DAL code to DAL2, slightly complicated by converting to C# at the same time. This first step should have been a piece of cake and I've hit a wall. All I want to do (for now) is query a view and display it in a datalist. Created a new project with the latest Christoc template, duplicated the View.* and item.cs and itemcontroller.cs, updated the manifest, and updated the view.ascx.cs to use the field names in the datalist. I made the model and controller to match the view, and the controller only does a GetAll since that's all I need (for now). I had to define a primary key on the decoration and return a portalid to get the caching to work, but now I get no errors, no records. I can find no real info on how to debug what's wrong. So my model has:  

[TableName("qryEventSummary")] //setup the primary key for table [PrimaryKey("RaceId", AutoIncrement = false)] //configure caching using PetaPoco [Cacheable("qryEventSummary_Items_", CacheItemPriority.Default, 20)] //scope the objects to the ModuleId of a module on a page (or copy of a module on a page) [Scope("PortalId")] class EventSummary { ///<summary> /// Property for RaceId () ///</summary> [ColumnName("RaceId")] int raceId { get; set; } ///<summary> /// Property for PortalId () ///</summary> [ColumnName("PortalId")] int portalId { get; set; }

 

and the controller has:

class EventSummaryController { public void CreateEventSummary(EventSummary t) { using (IDataContext ctx = DataContext.Instance()) { var rep = ctx.GetRepository<EventSummary>(); rep.Insert(t); } } public IEnumerable<EventSummary> GetEventSummary(int portalId) { IEnumerable<EventSummary> t; using (IDataContext ctx = DataContext.Instance()) { var rep = ctx.GetRepository<EventSummary>(); t = rep.Get(portalId); } return t; }

but the call to get all the items:

rptEventSummaryList.DataSource = tc.GetEventSummary(PortalId);

returns nothing.

 HELP!

 
New Post
11/2/2014 9:43 PM
 
Keith did you find any fix to this?
 
New Post
11/4/2014 8:50 AM
 

Can you remove the caching attribute and see if everything works without caching?  Whenever I run into situations like this, I try to simplify things as much as possible to get something working, then add in the various features until it stops working.  It is a bit of a slow effort but it can help you narrow down where to look.  Ultimately, you might need to load up a full source code version of the core framework to trace everything end to end.  I would also do a little db profiling to see if queries are going to the db.


Joe Brinkman
DNN Corp.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesDAL2 DebuggingDAL2 Debugging


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.

Content Layout

Subscribe to DNN Digest

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out