This document provides answers to common ASP.NET interview questions. It begins with questions about the differences between custom controls and user controls, ASP session state and ASP.NET session state, and datasets versus recordsets in ADO.NET. Subsequent questions cover topics like view state, authentication, caching, validation controls, and working with data controls.
Diving in OOP (Day 3): Polymorphism and Inheritance (Dynamic Binding/Run Time...Akhil Mittal
The document discusses runtime polymorphism in C# using method overriding. It shows how to override methods in a derived class by marking the base class methods as virtual and using the override keyword in the derived class. An experiment is conducted where calling a method on an object initialized as the base class but actually referring to a derived class instance results in the overridden method from the derived class being called due to runtime binding.
Diving in OOP (Day 6): Understanding Enums in C# (A Practical Approach)Akhil Mittal
My article of the series “Diving in OOP” will explain enum datatype in C#. We’ll learn by doing hands on lab and not only by theory. We’ll explore the power of enum and will cover almost every scenario in which we can use enum. We’ll follow a practical approach of learning to understand this concept. We may come across complex examples to understand the concept more deeply.
The document describes setting up unit testing for a Web API project using NUnit and Moq frameworks. It includes:
1. Adding a test project and installing necessary packages like NUnit, Moq, EntityFramework, and Newtonsoft.Json.
2. Defining variables and setting up mocks for the repositories, services, and UnitOfWork classes needed for the tests.
3. Writing tests for the ProductController including getting all products, getting a product by ID, and testing exceptions.
4. Explaining how to mock the repositories to simulate database operations during the tests.
So in summary, it covers the steps to set up a Web API project for unit testing and then provides examples
Diving in OOP (Day 2): Polymorphism and Inheritance (Inheritance)Akhil Mittal
ClassA inherits from ClassB, allowing ClassA to access methods and properties defined in ClassB like Display1(). Defining a method in ClassA with the same name as one in ClassB will override and hide the base method, unless base is used to explicitly call the base method. Inheritance does not work backwards - a base class does not have access to methods defined in a derived class.
Custom URL Re-Writing/Routing using Attribute Routes in MVC 4 Web APIsAkhil Mittal
We have already learnt a lot on WebAPI. I have already explained how to create WebAPI, connect it with database using Entity Framework, resolving dependencies using Unity Container as well as using MEF. In all our sample applications we were using default route that MVC provides us for CRUD operations. In this article I’ll explain how to write your own custom routes using Attribute Routing. We’ll deal with Action level routing as well as Controller level routing. I’ll explain this in detail with the help of a sample application. My new readers can use any Web API sample they have, else you can also use the sample applications we developed in my previous articles.
This document provides answers to common ASP.NET interview questions. It begins with questions about the differences between custom controls and user controls, ASP session state and ASP.NET session state, and datasets versus recordsets in ADO.NET. Subsequent questions cover topics like view state, authentication, caching, validation controls, and working with data controls.
Diving in OOP (Day 3): Polymorphism and Inheritance (Dynamic Binding/Run Time...Akhil Mittal
The document discusses runtime polymorphism in C# using method overriding. It shows how to override methods in a derived class by marking the base class methods as virtual and using the override keyword in the derived class. An experiment is conducted where calling a method on an object initialized as the base class but actually referring to a derived class instance results in the overridden method from the derived class being called due to runtime binding.
Diving in OOP (Day 6): Understanding Enums in C# (A Practical Approach)Akhil Mittal
My article of the series “Diving in OOP” will explain enum datatype in C#. We’ll learn by doing hands on lab and not only by theory. We’ll explore the power of enum and will cover almost every scenario in which we can use enum. We’ll follow a practical approach of learning to understand this concept. We may come across complex examples to understand the concept more deeply.
The document describes setting up unit testing for a Web API project using NUnit and Moq frameworks. It includes:
1. Adding a test project and installing necessary packages like NUnit, Moq, EntityFramework, and Newtonsoft.Json.
2. Defining variables and setting up mocks for the repositories, services, and UnitOfWork classes needed for the tests.
3. Writing tests for the ProductController including getting all products, getting a product by ID, and testing exceptions.
4. Explaining how to mock the repositories to simulate database operations during the tests.
So in summary, it covers the steps to set up a Web API project for unit testing and then provides examples
Diving in OOP (Day 2): Polymorphism and Inheritance (Inheritance)Akhil Mittal
ClassA inherits from ClassB, allowing ClassA to access methods and properties defined in ClassB like Display1(). Defining a method in ClassA with the same name as one in ClassB will override and hide the base method, unless base is used to explicitly call the base method. Inheritance does not work backwards - a base class does not have access to methods defined in a derived class.
Custom URL Re-Writing/Routing using Attribute Routes in MVC 4 Web APIsAkhil Mittal
We have already learnt a lot on WebAPI. I have already explained how to create WebAPI, connect it with database using Entity Framework, resolving dependencies using Unity Container as well as using MEF. In all our sample applications we were using default route that MVC provides us for CRUD operations. In this article I’ll explain how to write your own custom routes using Attribute Routing. We’ll deal with Action level routing as well as Controller level routing. I’ll explain this in detail with the help of a sample application. My new readers can use any Web API sample they have, else you can also use the sample applications we developed in my previous articles.
Learning MVC Part 3 Creating MVC Application with EntityFrameworkAkhil Mittal
This document discusses connecting an existing MVC application to a database using Entity Framework instead of LINQ to SQL. It provides steps to generate an Entity Data Model from an existing database, generate strongly typed entity classes, and modify the application's controllers to use the Entity Framework context instead of the LINQ to SQL context. The key steps are: 1) Adding an Entity Data Model file and generating entity classes; 2) Modifying controllers to use the Entity Framework context instead of LINQ to SQL; 3) Binding views to the generated entity classes. The document emphasizes that Entity Framework automates CRUD operations and allows focusing on business logic rather than data access code.
MVC Application using EntityFramework Code-First approach Part4Akhil Mittal
This document discusses connecting an MVC application to a database using Entity Framework's Code First approach. It explains that with Code First, domain models are designed first before the database is automatically generated. The steps shown create a DbContext class that inherits from DbContext and defines a DbSet for the User model. A connection string is added and the DbContext is used instead of the prior Entity Data Model classes. When run, the database is dynamically generated based on the model, allowing CRUD operations on the User table through the application and Entity Framework.
Diving in OOP (Day 4): Polymorphism and Inheritance (All About Abstract Class...Akhil Mittal
This document provides an overview of abstract classes in C# object-oriented programming. It defines abstract classes as classes that cannot be instantiated and must be implemented in derived classes. The document demonstrates several key features of abstract classes through code examples, including: defining abstract and non-abstract methods in abstract classes; inheriting from abstract classes to instantiate derived classes; and requiring derived classes to implement abstract methods from the base abstract class.
This document provides an overview of key points from the book of Hebrews in the Bible. It discusses how God has now spoken through his Son, Jesus, who is greater than the angels and sat at God's right hand. Jesus came to help humanity and offer himself as a sacrifice to take away sins. He is described as a merciful and faithful high priest who can empathize with human suffering. The document emphasizes listening to Jesus and having faith like him, rather than hardening one's heart. It references God's promise of rest and discusses Jesus as a priest in the line of Melchizedek.
1) Solomon firmly established control over Israel after becoming king, with God's support and blessing. He called together Israel's leaders.
2) Solomon led the assembly to Gibeon, where the Tabernacle of God was located. He sacrificed 1,000 burnt offerings there. That night, God promised Solomon wisdom if he asked.
3) Solomon wisely requested wisdom to rule God's people justly. God granted Solomon unprecedented wisdom and riches. Solomon then returned to Jerusalem and built up his military forces and wealth.
This document contains the text of the first letter to the Thessalonians from Paul. In the letter, Paul thanks the church in Thessalonica for their faith, work, and love. He reminds them to continue living moral, holy lives as they await the return of Jesus Christ. Paul also encourages the church to have hope, as they will be resurrected to be with Jesus upon his return. The letter concludes with final exhortations to continue living in a way that pleases God.
This letter from Paul provides instructions to Timothy on matters of church leadership and conduct. Paul urges Timothy to remain in Ephesus and stop the spread of wrong teachings. He outlines expectations for church elders and deacons, including that they be faithful, respectable leaders. Paul also provides instructions on other matters like prayer, women's roles, and caring for widows. The letter encourages Timothy to devote himself to ministry, preach the true teachings, and guard against false doctrines.
This letter from Peter encourages Christians living as foreigners in various regions to remain faithful to God. He reminds them that God chose them and through Christ they can have salvation and eternal life. Peter urges Christians to obey God, accept authorities, and live moral lives so as not to bring shame to God. He encourages slaves to obey masters respectfully and wives to accept husbands' authority. Overall, Peter exhorts Christians to endure suffering patiently, do good to others, and put their hope in God for salvation.
The book of Zephaniah contains prophecies of coming judgment and destruction from God against Judah, Jerusalem and surrounding nations due to their sin and idolatry. God will sweep away both people and animals, reducing the wicked to rubble. On the day of judgment God will punish leaders, priests and those following pagan customs. God will destroy Philistine cities and make the lands of Moab, Ammon and Assyria desolate. Jerusalem is especially rebellious and violent, refusing to listen to God. However, God will one day gather the survivors and restore Israel and Judah, living among them and removing all pride and fear.
The document summarizes chapters 1-4 of the book of Acts in the Bible. It describes Jesus' appearances after his resurrection and ascension to heaven. It then recounts the coming of the Holy Spirit at Pentecost, Peter's speech to the crowd explaining what happened, and the conversion of about 3,000 people. It details the healing of a lame man at the Temple by Peter and John, their arrest by religious leaders for preaching about Jesus, and their bold response that they must obey God rather than men.
Learning MVC Part 3 Creating MVC Application with EntityFrameworkAkhil Mittal
This document discusses connecting an existing MVC application to a database using Entity Framework instead of LINQ to SQL. It provides steps to generate an Entity Data Model from an existing database, generate strongly typed entity classes, and modify the application's controllers to use the Entity Framework context instead of the LINQ to SQL context. The key steps are: 1) Adding an Entity Data Model file and generating entity classes; 2) Modifying controllers to use the Entity Framework context instead of LINQ to SQL; 3) Binding views to the generated entity classes. The document emphasizes that Entity Framework automates CRUD operations and allows focusing on business logic rather than data access code.
MVC Application using EntityFramework Code-First approach Part4Akhil Mittal
This document discusses connecting an MVC application to a database using Entity Framework's Code First approach. It explains that with Code First, domain models are designed first before the database is automatically generated. The steps shown create a DbContext class that inherits from DbContext and defines a DbSet for the User model. A connection string is added and the DbContext is used instead of the prior Entity Data Model classes. When run, the database is dynamically generated based on the model, allowing CRUD operations on the User table through the application and Entity Framework.
Diving in OOP (Day 4): Polymorphism and Inheritance (All About Abstract Class...Akhil Mittal
This document provides an overview of abstract classes in C# object-oriented programming. It defines abstract classes as classes that cannot be instantiated and must be implemented in derived classes. The document demonstrates several key features of abstract classes through code examples, including: defining abstract and non-abstract methods in abstract classes; inheriting from abstract classes to instantiate derived classes; and requiring derived classes to implement abstract methods from the base abstract class.
This document provides an overview of key points from the book of Hebrews in the Bible. It discusses how God has now spoken through his Son, Jesus, who is greater than the angels and sat at God's right hand. Jesus came to help humanity and offer himself as a sacrifice to take away sins. He is described as a merciful and faithful high priest who can empathize with human suffering. The document emphasizes listening to Jesus and having faith like him, rather than hardening one's heart. It references God's promise of rest and discusses Jesus as a priest in the line of Melchizedek.
1) Solomon firmly established control over Israel after becoming king, with God's support and blessing. He called together Israel's leaders.
2) Solomon led the assembly to Gibeon, where the Tabernacle of God was located. He sacrificed 1,000 burnt offerings there. That night, God promised Solomon wisdom if he asked.
3) Solomon wisely requested wisdom to rule God's people justly. God granted Solomon unprecedented wisdom and riches. Solomon then returned to Jerusalem and built up his military forces and wealth.
This document contains the text of the first letter to the Thessalonians from Paul. In the letter, Paul thanks the church in Thessalonica for their faith, work, and love. He reminds them to continue living moral, holy lives as they await the return of Jesus Christ. Paul also encourages the church to have hope, as they will be resurrected to be with Jesus upon his return. The letter concludes with final exhortations to continue living in a way that pleases God.
This letter from Paul provides instructions to Timothy on matters of church leadership and conduct. Paul urges Timothy to remain in Ephesus and stop the spread of wrong teachings. He outlines expectations for church elders and deacons, including that they be faithful, respectable leaders. Paul also provides instructions on other matters like prayer, women's roles, and caring for widows. The letter encourages Timothy to devote himself to ministry, preach the true teachings, and guard against false doctrines.
This letter from Peter encourages Christians living as foreigners in various regions to remain faithful to God. He reminds them that God chose them and through Christ they can have salvation and eternal life. Peter urges Christians to obey God, accept authorities, and live moral lives so as not to bring shame to God. He encourages slaves to obey masters respectfully and wives to accept husbands' authority. Overall, Peter exhorts Christians to endure suffering patiently, do good to others, and put their hope in God for salvation.
The book of Zephaniah contains prophecies of coming judgment and destruction from God against Judah, Jerusalem and surrounding nations due to their sin and idolatry. God will sweep away both people and animals, reducing the wicked to rubble. On the day of judgment God will punish leaders, priests and those following pagan customs. God will destroy Philistine cities and make the lands of Moab, Ammon and Assyria desolate. Jerusalem is especially rebellious and violent, refusing to listen to God. However, God will one day gather the survivors and restore Israel and Judah, living among them and removing all pride and fear.
The document summarizes chapters 1-4 of the book of Acts in the Bible. It describes Jesus' appearances after his resurrection and ascension to heaven. It then recounts the coming of the Holy Spirit at Pentecost, Peter's speech to the crowd explaining what happened, and the conversion of about 3,000 people. It details the healing of a lame man at the Temple by Peter and John, their arrest by religious leaders for preaching about Jesus, and their bold response that they must obey God rather than men.