Boxing and Unboxing

Boxing is used to store value types in the garbage-collected heap. Boxing is an implicit conversion of a value type to the type object or to any interface type implemented by this value type. Boxing a value type allocates an object instance on the heap and copies the value into the new object Boxing Conversion explicit boxing is never required:… Read more →

Use as and is Operators for casting

The as operator is more efficient because it actually returns the cast value if the cast can be made successfully. The is operator returns only a Boolean value. It can therefore be used when we just want to determine an object’s type but do not have to actually cast it. Use the is operator to verify the type before performing a… Read more →

jQuery Validation

<!DOCTYPE html> <html xmlns=”http://www.w3.org/1999/xhtml”> <head> <title>Validation</title> <link href=”http://cdnjs.cloudflare.com/ajax/libs/jQuery-Validation-Engine/2.6.4/validationEngine.jquery.css” rel=”stylesheet” /> <script src=”http://cdnjs.cloudflare.com/ajax/libs/jQuery-Validation-Engine/2.6.4/jquery-1.8.2.min.js”></script> <script src=”http://cdnjs.cloudflare.com/ajax/libs/jQuery-Validation-Engine/2.6.4/languages/jquery.validationEngine-en.js”></script> <script src=”http://cdnjs.cloudflare.com/ajax/libs/jQuery-Validation-Engine/2.6.4/jquery.validationEngine.js”></script> <script type=”text/javascript” src=”http://cdn.b3website.com/jquery-inputmask/jquery.inputmask.bundle.min.js”></script> <script type=”text/javascript”> $(document).ready(function () { jQuery(“#MyForm”).validationEngine(); }); </script> </head> <body> <form id=”MyForm” class=”formular” method=”post”> <br /><br /><br /> <input id=”Text1″ type=”text” class=”validate[required,custom[integer],max[50]] text-input” /><br /><br /> <input id=”Text2″ type=”text” class=”validate[required] text-input” /><br /><br /> <input id=”Text3″ type=”text” class=”validate[required] text-input” /><br /><br… Read more →

Visual C# Code Snippets

Link     By default the following code snippets are included in Visual Studio. Name (or shortcut) Description Valid locations to insert snippet #if Creates a #if directive and a #endif directive. Anywhere. #region Creates a #region directive and a #endregion directive. Anywhere. ~ Creates a destructor for the containing class. Inside a class. attribute Creates a declaration for a class that derives from Attribute. Inside a namespace (including… Read more →

Entity framework questions

1) What is the advantage and disadvantage of Entity Framework Advantages: One common syntax (LINQ) for all object queries whether it is database or not , Pretty fast if used as intended , easy to implement SoC , less coding required to accomplish complex tasks. Its fast and straight forward using LINQ/FE objects For Add/Modify/Delete/Update. Easy to map business objects… Read more →

Value Types and Reference Types Comparison

Intriguing Question Value Type Reference Type How is a variable represented? Value type variables are local copies. Reference type variables are pointing to the memory occupied by the allocated instance. What is the base type? Implicitly extends System.ValueType. Can derive from any other type (except System. ValueType), as long as that type is not “sealed” (more details on this in… Read more →