LINQPad – Cool Utility For LINQ

יום שבת, יוני 14, 2008

Maybe you know about this, but I saw it first few days a go. I officially in love. LINQPad is a cool little utility that was mainly created to allow you to test LINQ expressions and see them produce a  result and output the results in a nice easy to visualize format. It's great for running LINQ Queries without having to fire up Visual Studio. LINQPad is also a great way to learn LINQ: it comes preloaded with 200 examples from the book,"C# 3.0 in a Nutshell" written by Joseph Albahari, the author...
אין תגובות

Visual Studio 2008 and .NET Framework 3.5 Training Kit

יום שבת, מרץ 29, 2008

Microsoft released a nice training kit (~126MB) (it's a real treasure!) for the latest technologies. This package covers a bunch of technologies and includes presentations, hands-on labs, and demos. This content is designed to help you learn how to utilize the Visual Studio 2008 features and a variety of framework technologies including: Visual Studio Tools for Office Visual Studio Team System Application Lifecycle Management C# 3.0 VB 9.0 LINQ ...

.NET Framework Source Code Available

יום שבת, ינואר 19, 2008

It's here and you can give it a try now! To step through .NET Framework Source code, here's what you need to do. Install the Visual Studio 2008 QFE.  This Hotfix just updates a DLL that's part of the Visual Studio debugger that fetches the source files, more details on the download page. (64-bit users: read the description as there is a single manual step for 64-bit) Go into Tools > Options > Debugging > General and turn off "Enable Just My Code" and turn on "Enable Source Server" ...
תגיות: ,
אין תגובות

.NET Framework Multi Targeting in Visual Studio 2008

יום רביעי, אוקטובר 17, 2007

One of the great features in Visual Studio 2008 is the ".NET Framework Multi Targeting".  This allows you to build applications targeting any of these frameworks using Visual Studio 2008: .NET Framework 2.0 - released with Visual Studio 2005 .NET Framework 3.0 - released with Windows Vista .NET Framework 3.5 - will release with Visual Studio Orcas After I built a project targeted .NET framework 2.0 I encountered problem on a machine with .NET framework 2.0 installed. It turns out that when installing Visual Studio 2008, it also install .NET framework 2.0 SP1. Hence, this...
אין תגובות

Query types using LINQ

יום שני, אוקטובר 1, 2007

It's great. It's so beautiful. I really like it. Reflecting types using LINQ. How can we do it? We can use Reflection of course, but with LINQ it shortest and simplest. Declare "Type" object , assign the class you want to query and query with LINQ. Example 1: To get all methods of a class: 1: Type tPerson = typeof(Person); 2: var methods = from method in tPerson.GetMethods() 3: select method; 4:...
תגיות: , ,
תגובה אחת

C# 3.0 Extension Methods

יום חמישי, ספטמבר 27, 2007

How many times have you written wrapper methods for objects that in reality you wished were part of the object itself?For example, we have the following method which returns the first and last char of a given string in upper case: 1: namespace MaorDavidsBlogExamples 2: { 3: public static class Extensions 4: { 5: public static string UpperFirstAndLast(string str) 6: ...
אין תגובות

C# Automatic Properties

יום רביעי, ספטמבר 26, 2007

Visual Studio 2008 and .NET 3.5 introduces us new feature: Automatic Properties. You probably write classes with properties like this: 1: public class Student 2: { 3: private string _firstName; 4:   5: public string FirstName 6: { 7: get { return _firstName; } 8: set...
אין תגובות

Getting started with LINQ

יום שני, ספטמבר 24, 2007

Language Integrated Query (LINQ) introducing a standard set of operators that can be used to query several different data stores such as SQL Server and XML. LINQ comes as part of the future revisions of both the C# and VB.NET compilers (VS 2008). LINQ architecture As we see at the figure below, the data to be queried can take the form of XML (LINQ to XML), databases (LINQ-enabled ADO.NET, which includes LINQ to SQL, LINQ to Dataset and LINQ to Entities), objects (LINQ to Objects), and so on. (Click to enlarge every image) Each...
תגובה אחת

C# 3.0 var keyword

יום שבת, ספטמבר 15, 2007

C# 3.0 has many-a-new features. This post will explain the 'var' keywork and the concept of Implicitly Typed Variables. The var keyword is not a late-bound or un-typed variable reference. The var keyword always generates a strongly typed variable reference. The main idea is that the developer is not required to define the type of the variable at the time of declaration, but it is the task of the compiler to decide what type of the object the variable is. The compiler infer the type of the variable from the expression used to initialize the variable when it is first declared. Important points about...
תגיות: , ,
3 תגובות

Lambda expressions introduction

יום שישי, ספטמבר 7, 2007

NET 2.0 introduced Anonymous Methods. The idea behind anonymous methods it to write methods inline to the code. They are mainly used for small methods that don't require any need for reuse. For example, we have this code: 1: bool isGreaterThan5(int n) 2: { 3: return n > 5; 4: } 5:  6: ... 7:  8: int GetGreatersThanFives(List<int> numbers) 9: { 10: return numbers.Find(isGreaterThan5); 11: }We can...
2 תגובות