Tuesday, October 30, 2018

Page life cycle of MVC

Below are the processed followed in the sequence -
→App initialization
→Routing
→Instantiate and execute controller
→Locate and invoke controller action
→Instantiate and render view.

Thursday, October 11, 2018

EF 6 Code-First Conventions

 Conventions  are the default rules which automatically configure a conceptual model.

Tuesday, October 9, 2018

Create Connection With Store Procedure with MySql in c#

MySqlConnection con = new MySqlConnection("server=YourServerName;port=3306;
database=yourdbname;uid=youruid;pwd=your PWD;");
string firstparanamevalue="Your Value";
string secondparanamevalue="Your Value";
MySqlCommand cmd1 = new MySqlCommand();
cmd1 = con.CreateCommand();
cmd1.CommandText = "YourProcedureName";
cmd1.CommandType = CommandType.StoredProcedure;
cmd1.Parameters.AddWithValue("firstparaname", firstparanamevalue);
cmd1.Parameters.AddWithValue("secondparaname", secondparanamevalue);
con.Open();
cmd1.ExecuteNonQuery();
con.Close();


If Any Problem Please Comment.

Confirmation in Window Form in c#

var confirmResult = MessageBox.Show("Click 'Yes' To Close or 'No' to Cancel ??","Confirm To Close!!",MessageBoxButtons.YesNo);

            if (confirmResult == DialogResult.Yes)
            {
              //Your Code
            }

Action Filter in MVC

Whenever A user request is routed to a controller there may be a need to execute some logic before or after execution of particular operation ,For Achieving this ASP .Net provides functionality Called Action Filter.

Types of Filters

1. Action Filter :

      Action filter is a logic which execute after and before a controller action executes.

2. Authorization Filter :

       Authorization filter is used to implement authentication and  Authorization on controller action.

3. Result Filter :

       Result Filter is used to execute after and before view result is executed.

4. Exception Filter

        Exception Filter are used to handle errors raised by your controller and controller result.