This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Text; | |
namespace DataExportClass | |
{ | |
class Program | |
{ | |
public class Employee |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Globalization; | |
using System.Reflection; | |
namespace TestingReflection | |
{ | |
public class Program | |
{ | |
static void Main(string[] args) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Reflection; | |
namespace TestingReflection | |
{ | |
public class Program | |
{ | |
static void Main(string[] args) | |
{ | |
/* To get access to the PublicKeyToken of an Assembly you need to execute sn.exe and pass the Assembly path. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MultiThreadingExamples | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Task thePowerfulTask = Task.Run(() => | |
{ | |
for (var i = 0; i < 1000; i++) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MultiThreadingExamples | |
{ | |
public static void UltraCoolMethod() | |
{ | |
const int iterationNumber = 10; | |
for (var i = 0; i < iterationNumber; i++) | |
{ | |
Console.WriteLine($"Execution Thread Nº {i}"); | |
Thread.Sleep(0); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MultiThreadingExamples | |
{ | |
public static void UltraCoolMethod() | |
{ | |
const int iterationNumber = 10; | |
for (var i = 0; i < iterationNumber; i++) | |
{ | |
Console.WriteLine($"Execution Thread Nº {i}"); | |
Thread.Sleep(0); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MultiThreadingExamples | |
{ | |
class ParametrizedThreadStartExample | |
{ | |
public static void UltraCoolMethod(object o) | |
{ | |
for (var i = 0; i < (int)o; i++) | |
{ | |
Console.WriteLine($"Execution Thread Nº {i}"); | |
Thread.Sleep(0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MultiThreadingExamples | |
{ | |
class UsingThreadPools | |
{ | |
static void Main(string[] args) | |
{ | |
ThreadPool.QueueUserWorkItem((work) => | |
{ | |
Console.WriteLine("Luis is trying to do something here..."); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MultiThreadingExamples | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Task<string> thePowerfulTaskWithReturn = Task | |
.Run(() => "Luis is ") | |
.ContinueWith((firstResult) => firstResult.Result + " sleepy!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MultiThreadingExamples | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Stopwatch myStopWatch = new Stopwatch(); | |
Task[] aSetOfTasks = new Task[3]; |
OlderNewer