User Data vs. Content Creation

Topics: Customizing Orchard, Writing modules
Oct 1, 2013 at 10:35 PM
Edited Oct 1, 2013 at 10:36 PM
I've been swimming in the Modules tutorials for Orchard for the last couple of days, and while they are mostly pretty good, I think I'm running into a fundamental disconnect between what I want to do, and what the primary purpose is for modules.

Everything in the tutorials, and in the downloadable modules that I've looked at so far, seems to be geared towards creating new customized content for the website. But I want to create modules that allow the users to create custom data for themselves that is not specifically content for the website.

For example, I need to create a custom form that is geared towards collecting data that my wife needs for course registrations. The user would fill all of the data out, it would be saved to a custom table in the database, and then my wife could see the results--both in a list of everyone who has submitted a registration in a particular timeframe, and in a page that is populated with data from a single user.

As I've said, I've been looking extensively at the tutorials for modules, and I'm not quite seeing how to get from here to there. I decided to dig into the Comments module, as that seemed to be the closest analog to my needs, but there is a lot going on there, so I'm not quite sure where to start.

This is an issue that is going to come up in at least a couple more scenarios for this site. Registered users will be able to keep track of personal information, based on the courses they will be taking.

Am I trying to do something with Orchard that is really outside of its paradigm? Or is there a process I can follow that will lead me to the promised land?

Thanks for any help with this. I'm really hoping there's a straight-forward method for handling this.
Developer
Oct 1, 2013 at 10:44 PM
There is a straight-forward method for handling this. Basically, create your models and migration, then inject IRepository<TModel> of your models into any class you need access to those repositories.
Oct 2, 2013 at 12:03 AM
sfmskywalker wrote:
There is a straight-forward method for handling this. Basically, create your models and migration, then inject IRepository<TModel> of your models into any class you need access to those repositories.
Can you say more about this? I am returning to ASP.Net coding after a multi-year hiatus. So my chops in this area are a bit rusty. I've been through many of the Pluralsight videos on MVC, as well as much of the intro to Orchard, but I am not in any way versed in the intricacies of how it all works.

I did some googling to see if there were any clear explanations of injecting IRepository<TModel>, but it all still seems kinda Greekish to me. ;-)

If you can point me towards some good references, I'd appreciate it.
Developer
Oct 2, 2013 at 12:24 AM
Oh ok. Well, I don't know of any reference discussing IRepository<T> in isolation in Orchard, but I do recommend reading up on the repository pattern, and this tutorial might help. It's a long read, but I believe it discusses dependency injection and how to work with IRepository. If not, I'll write on shortly.
Developer
Oct 2, 2013 at 12:24 AM
Developer
Oct 2, 2013 at 12:25 AM