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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
IEnumerable<string> values = GetStrings().Take(10); | |
foreach (string value in values) | |
{ | |
Console.WriteLine(value); | |
} |
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.IO; | |
using System.Net; | |
using System.Net.FtpClient; | |
using System.Threading.Tasks; | |
namespace FtpClientSample | |
{ | |
class Program | |
{ |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
IEnumerable<string> basket1 = new List<string> { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }; | |
IEnumerable<string> basket2 = new List<string> { "11", "12", "13", "14", "15", "16", "17", "18", "19", "20" }; | |
IEnumerable<string> basket3 = new List<string> { "21", "22", "23", "24", "25", "6", "7", "8", "9", "30" }; | |
foreach (var item1 in basket1) | |
foreach (var item2 in basket2) |
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.Linq; | |
using System.Reflection; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using Raven.Abstractions.Indexing; | |
using Raven.Client; | |
using Raven.Client.Embedded; | |
using Raven.Client.Indexes; |
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
command = "powershell.exe -nologo -command D:\scripts\backup.ps1" | |
set shell = CreateObject("WScript.Shell") | |
shell.Run command,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
<script> | |
(function () { | |
$('select[name="ProductVersion"]').change(function (e) { | |
var $this = $(this), | |
desiredVersion = $this.val(), | |
currentPath = document.location.pathname + document.location.search, | |
currentPathWithoutVersion = currentPath.substring(currentPath.indexOf('/', 1) === -1 ? currentPath.length : currentPath.indexOf('/', 1), currentPath.length), | |
targetLocation = '/' + desiredVersion + currentPathWithoutVersion; | |
document.location = targetLocation; |
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
public class PersonRequestModel | |
{ | |
public string FirstName { get; set; } | |
public string LastName { get; set; } | |
public int Age { get; set; } | |
} | |
public class PersonDto | |
{ | |
public int Id { get; set; } |
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
// Data Layer Model (Entity) | |
public class Store : IEntity<int>, ISlug, ILocatable | |
{ | |
public int Id { get; set; } | |
public string TypeId { get; set; } | |
[Required] | |
[StringLength(50)] | |
public string Name { get; set; } |
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
-- Create Data | |
-- Create an Employee table. | |
CREATE TABLE dbo.MyEmployees | |
( | |
EmployeeID smallint NOT NULL, | |
FirstName nvarchar(30) NOT NULL, | |
LastName nvarchar(40) NOT NULL, | |
Title nvarchar(50) NOT NULL, | |
DeptID smallint NOT NULL, |
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
public enum MyEnum : byte | |
{ | |
A = 0, | |
B = 1, | |
C = 2 | |
} | |
Array enumNames = Enum.GetNames(typeof(MyEnum)); | |
Array enumValues = Enum.GetValues(typeof(MyEnum)); | |
for (int i = 0; i < enumValues.Length; i++) |