Delegates VS Interfaces

Continue from the article About Delegate and Callback post yesterday, I am thinking of using interfaces instead of delegates. Here is the guide from MSDN  When to Use Delegates Instead of Interfaces. Both delegates and interfaces enable a class designer to separate type declarations and implementation. A given interface can be inherited and implemented by any class …

Read More

About Delegate and Callback

Delegate and Callback, are they exactly the same or similar? Sometimes I am confused with it. We have delegate mechanism in C#, callback function in JavaScript and function pointer in C. In addition, we have events, observer, asynchronous function , they are different but closely related to each other. Maybe I need to figure them out …

Read More

A Simple Practice of C# Reflection

Reflection refers to the ability to examine code and dynamically read, modify, or invoke behavior for an assembly, module, or type. This means that you can instantiate a class or invoke a method dynamically. The name of the class or method becomes an variable. The flexibility of Reflection makes it a powerful feature that can be used with some …

Read More

A Brief Summary of LINQ

LINQ is a very powerful tool in .NET Framework especially when operating Collection or Database (CRUD).  In Web Application development, we use it all the time for Database query. It’s important and we can hardly leave. Here is a brief summary of LINQ. Most of the contents are from the book MCSD Certification Toolkit (Exam 70-483). What is LINQ …

Read More

Hello world! The first Tech blog

This is my first tech blog, just for testing Test picture insert: Drag and drop   Test the Enlighter Code Snippet Tool, easy to use and setup. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using RazorTest.Models; namespace RazorTest.Controllers { public class HomeController : Controller { Product myProduct = new Product { ProductID …

Read More