Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » C# » General » Downloads
 
Add your own
alternative version

Tagged as

How does it work in C#? - Part 2

, 4 Feb 2013 CPOL
How does throw, rethrow and where, select clause of Enumerable class work in C# programming language.
Demo.zip
Demo
TestHarnessPart2.exe
HowDoesItWork.zip
HowDoesItWork
HowDoesItWork.sln.vsdoc
HowDoesItWork.suo
TestHarness
bin
Debug
TestHarness.exe
TestHarness.pdb
TestHarness.vshost.exe
TestHarness.vshost.exe.manifest
obj
x86
Debug
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
TestHarness.exe
TestHarness.pdb
Properties
TestHarness.vsdoc
TestHarnessPart2
bin
Debug
TestHarnessPart2.exe
TestHarnessPart2.pdb
TestHarnessPart2.vshost.exe
Release
obj
x86
Debug
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
TestHarnessPart2.exe
TestHarnessPart2.pdb
Properties
TestHarnessPart2.vsdoc
namespace TestHarnessPart2
{
    using System;
    class Program
    {
        static void Main(string[] args)
        {
            TestWhereSelect();
            TestFuncExample();
        }

        private static void TestWhereSelect()
        {
            WhereSelect whereSelect = new WhereSelect();
            var result = whereSelect.GetBookListWhichLengthIsGreaterThan(2);
        }

        private static void TestFuncExample()
        {
            ExampleOfFunc exampleOfFunc = new ExampleOfFunc();
            Console.WriteLine(exampleOfFunc.TestFunc("Example of Func", (dataToTest) => dataToTest.Length));
        }
    }



    ////Note: Please comment above Program class and uncomment the below Program class to test Exception details.
    ////For simplicity reason I did not seperate this into its own test class to test exception details
    //using System;
    //class Program
    //{
    //    static void Main(string[] args)
    //    {
    //        try
    //        {
    //            Person person = new Person();
    //        }
    //        catch (Exception exceptionObject)
    //        {

    //            // Comment the above throw statement when using below line of code.
    //            throw exceptionObject;
    //        }
    //    }
    //}
    //public class Person
    //{
    //    public Person()
    //    {
    //        throw new Exception("Exception from Person");
    //    }
    //}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author


| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.1411023.1 | Last Updated 4 Feb 2013
Article Copyright 2011 by Mohammad A Rahman
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid