asp.net mvc - Preferred method of adding records to custom tables in Umbraco? -
i've finished creating custom surface controller sends out emails after user has filled in details of contact form.
however i'm trying store these records in custom table i'm not sure available methods have of doing this? in previous versions of umbraco ie. < 4.8 i'd create linq 2 sql classes , save records using datacontext object.
now umbraco 6 has moved mvc i'm little unsure how should proceed. i've been looking using entity framework add custom records i've seen this article , wonder if there's simpler way of adding these new records database?
is able point me in right direction here? optimal way of adding records custom tables in umbraco 6?
thanks!
there 2 answers question:
- use framework/solution ef;
- use contour
if haven't looked @ it, contour umbraco plugin need. see here more information contour.
however, more control use petapoco or more npoco (via nuget) , autofac inject database (analogous datacontext) constructor of controllers.
this super easy , if aren't using ioc container autofac in builds highly recommend looking it. if stick ef, ensure single datacontext object created , disposed each request, making sure didn't have multiple contexts floating about.
Comments
Post a Comment