-3

i want to develop a big application using MVC4(this is suggested by most of people as its new and have more features) and EF.

I am pretty sure that i will have more than 100 tables and more than 50,000 records in each table so mostly i am concern with speed of application.i will search in above data.

Now questions are

1- should i use DBFirst or CodeFirst or what other?

2-which one would be fast running.i need speed.

3- how to avoid server controls/use to improve speed.

Please note that i am using EF in dotnet.

Now what i was using till now to develop an application in webforms.please check my below code and tell me can i do it in MVC?

$.ajax({

        type: 'POST',
        url: 'Default.aspx/GetGenCategories',
        data: "{}",
        contentType: 'application/json; charset=utf-8',
        dataType: 'json',
        success: function (msg) {
            var table = '<thead><tr><th></th></tr></thead><tbody>';

            //loop each record
            for (var i = 0; i < msg.d.length; i++) {
                table += '<tr><td class="text16size_hyper">' + msg.d[i].CategoryName + '</td></tr>';


            }
            table += '</tbody>';
            $('#gen_Cat').html(table).dataTable();

        }

    });

now on code page i have this

[System.Web.Services.WebMethod()]
[System.Web.Script.Services.ScriptMethod()]
public static List<clsGeneral> GetGenCategories()
{
    //make object of city class
    clsGeneral cl = new clsGeneral();
    return cl.GetGenCategories();

}

amd here is my class

public List<clsGeneral> GetGenCategories()
{

    try
    {


        Database db = DatabaseFactory.CreateDatabase();

        DbCommand oCmd = db.GetStoredProcCommand("SP");

        DataSet dsResult = db.ExecuteDataSet(oCmd);

        var query = from o in dsResult.Tables[0].AsEnumerable()
                    select new clsGeneral
                    {
                        Cat_id = o.Field<int>("Cat_id"),
                        CategoryName = o.Field<string>("CategoryName")


                    };
        List<clsGeneral> lstDisplay = new List<clsGeneral>();
        lstDisplay.AddRange(query);
        return lstDisplay;



    }

..........

tereško
  • 58,060
  • 25
  • 98
  • 150
Methew
  • 359
  • 4
  • 10
  • 28
  • "please check my below code and tell me can i do it in MVC?" Is that a separate question? Did you try anything? – woz Mar 28 '13 at 12:14

1 Answers1

1

Check out this thread that shows the difference between Code First vs Model First and choose that suits you.

There are no server controls in Asp.net MVC. In fact you can control the HTML to be rendered.

What you can do with web-forms, definitely you can do it in MVC. Approach would be different.

Community
  • 1
  • 1
Nilesh Thakkar
  • 2,877
  • 1
  • 24
  • 43