NHibernate with ASP.NET Gridviews and an ObjectDataSource work super.
If you already are writing business object level tests, then hooking
your business objects up to a gridview using ObjectDataSource is close
to writing no code at all.
Although this isn't a great example anymore, the link below shows
using an object datasource:
http://code.google.com/p/systembusinessobjects/source/browse/trunk/Examples/


On Sep 25, 7:25 pm, "Sidar Ok" <[EMAIL PROTECTED]> wrote:
> With grid, you handle the events, and every DataItem is your model object.
> I have done a similar work for Linq to SQL, since you will be binding the
> model objects it should essentially be no different.
>
> http://www.sidarok.com/web/blog/content/2008/06/02/linq-to-sql-with-w...
> you can download the codes, it has an example.
>
>
>
>
>
> On Thu, Sep 25, 2008 at 10:19 AM, Luis Abreu <[EMAIL PROTECTED]> wrote:
>
> > Well, you'll have to handle the events fired by the grid which are
> > automatically handled by the data source controls. Getting them is
> > easy: if you try to perform the operations and haven't set up the
> > events, you'll get an exception.
>
> > On Thu, Sep 25, 2008 at 9:23 AM, Thomas Koch <[EMAIL PROTECTED]> wrote:
>
> > > Well, I would really like to see some examples of using only the NH
> > > domain models with a GridView supporting editing, deleting, sorting,
> > > paging, etc. without using ObjectDataSource.
>
> > > Does anyone have a nice resource for this?
>
> > > Kind regards
> > > Thomas
>
> > > On 25 Sep., 10:00, "Luis Abreu" <[EMAIL PROTECTED]> wrote:
> > >> +1.
>
> > >> Even though I haven't used ASP.NET in real work for some time now, I
> > >> can confirm that if you have a decent domain model, your asp.net code
> > >> will be reduced to 2 or 3 lines of code in these cases. This means
> > >> that you'll end up writting less code vy using the codebehind file
> > >> than if you write the aspz code necessary for setting up the
> > >> objectdatasource control...
>
> > >> On Wed, Sep 24, 2008 at 10:58 PM, Sidar Ok <[EMAIL PROTECTED]> wrote:
> > >> > Sorry for jumping in, but what stops you from binding your model
> > entities
> > >> > directly as a collection in entirety ?
> > >> > My single advice on using datasources, would be, "don't" . anything
> > beyond
> > >> > basic is proven to cause a lot of pain.
>
> > >> > On Wed, Sep 24, 2008 at 8:20 PM, Thomas Koch <[EMAIL PROTECTED]>
> > wrote:
>
> > >> >> Hi Patrick - I am using NH with GridViews and ObjectDataSources all
> > >> >> the time, and it works like a charm.
>
> > >> >> Check this link:
>
> >http://www.codeproject.com/KB/architecture/NHibernateBestPractices.aspx
>
> > >> >> I emply the Dao architecture that Billy MacCaffery is using in that
> > >> >> article for the "DAL" part of my application.
>
> > >> >> I also create some classes that work well with the ObjectDataSource.
> > >> >> An example might be a  CustomerBLL that has the methods for
> > retrieval,
> > >> >> update, delete, etc. This CustomerBLL in turn will invoke the Dao
> > >> >> classes to get the work done.
>
> > >> >> These BLL classes might seem like a little extra work, but on the
> > >> >> other hand I get a very thin code-behind file for my  aspx pages,
> > >> >> where I only check on whether or not an exception has occurred in the
> > >> >> BLL - DAL chain of objects.
>
> > >> >> Hope this helps.
>
> > >> >> Cheers,
> > >> >> Thomas
>
> > >> >> On 24 Sep., 13:24, pn <[EMAIL PROTECTED]> wrote:
> > >> >> > Hi,
>
> > >> >> > My team is looking for a solution to use NHibernate with ASP.NET
> > >> >> > GridView (for all CRUD operations).  I have searched around and
> > only
> > >> >> > found scattered materials for this topic.
>
> > >> >> > Wonder if there is any best practice out there?
>
> > >> >> > I also saw that LINQ to NHibernate might be an answer because in
> > .NET
> > >> >> > 3.5 there is a LinqDataSource.  However, how ready is the Linq for
> > >> >> > NHibernate in NHibernateContrib?  Anyone have tried it?
>
> > >> >> > Thanks,
> > >> >> > - Patrick
>
> > >> > --
> > >> > Sidar Ok
> > >> >http://www.sidarok.com
>
> > >> --
> > >> Regards,
> > >> Luis Abreu- Skjul tekst i anførselstegn -
>
> > >> - Vis tekst i anførselstegn -
>
> > --
> > Regards,
> > Luis Abreu
>
> --
> Sidar Okhttp://www.sidarok.com- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to