SQL, MVC and Hosted Internet Applications
===

I have got to create an internet web application, hosted by a 3rd party, everything managed data-centric, stored procedures on SQL Server.

I assume I can use MVC still? (don't like asp.net/webforms)

For this project, I want to use MVC if possible but not an ORM etc.

I was thinking of creating like a business layer of classes for the app, and a DAL. The dal would handle all the database stuff (SQL etc).

As long as I return valid data for a controller to pass to a view etc, that's okay isn't it?

So lets say I had a business object called "contact"...

I would declare an instance of the DAL class in the controller , eg:

    private ContactDAL db = new ContactDAL();

and then in the HTTPPOST of a controller for example, I could maybe have something like

 

    [HttpPost]
            public ActionResult Create(Contact contact)
            {
                if (ModelState.IsValid)
                {
                    db.Add(contact); // this would save to SQL server via stored proc or SQL
                    db.Save(); // the save method would therefore probably be redundant
                    return RedirectToAction("Index");  
                }
    
                return View(contact);
            }

Seems easy enough to me, or am i missing something? Would this work?

....Or would I be better using ORM?

Thanks


