This file contains 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
static void Main(string[] args) | |
{ | |
List<Post> Facebook = new List<Post>(); | |
Facebook.Add(new Post { status = "status A", timestamp = DateTime.Now }); | |
Facebook.Add(new Post { status = "status B", timestamp = DateTime.Now }); | |
Facebook.Add(new Post { status = "status C", timestamp = DateTime.Now }); | |
foreach(Post p in Facebook) | |
{ | |
Console.WriteLine($"Status: {p.status} - Datetime: {p.timestamp}"); | |
} |
This file contains 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 FacebookWall | |
{ | |
private List<Post> facebook; | |
public FacebookWall() | |
{ | |
facebook = new List<Post>(); | |
} | |
public void Add(Post npost) | |
{ | |
facebook.Add(npost); |
This file contains 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
static void Main(string[] args) | |
{ | |
FacebookWall Facebook = new FacebookWall(); | |
Facebook.Add(new Post { status = "status A", timestamp = DateTime.Now }); | |
Facebook.Add(new Post { status = "status B", timestamp = DateTime.Now }); | |
Facebook.Add(new Post { status = "status C", timestamp = DateTime.Now }); | |
foreach(Post p in Facebook) | |
{ | |
Console.WriteLine($"Status: {p.status} - Datetime: {p.timestamp}"); | |
} |
This file contains 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 FacebookWall: IEnumerable<Post> | |
{ | |
private List<Post> facebook; | |
public FacebookWall() | |
{ | |
facebook = new List<Post>(); | |
} | |
public void Add(Post npost) | |
{ | |
facebook.Add(npost); |
This file contains 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 static class ConsoleExtension | |
{ | |
public static void ToConsole<T>(this IEnumerable<T> s, string header) | |
{ | |
Console.WriteLine($"*********BEGIN {header}**************"); | |
foreach (T item in s) | |
{ | |
Console.WriteLine(item); | |
} | |
Console.WriteLine($"*********END {header}**************"); |
This file contains 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 static class ConsoleExtension | |
{ | |
public static void ToConsole<T>(this IEnumerable<T> s, string header) | |
{ | |
Console.WriteLine($"*********BEGIN {header}**************"); | |
foreach (T item in s) | |
{ | |
Console.WriteLine(item); | |
} | |
Console.WriteLine($"*********END {header}**************"); |
This file contains 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
<?xml version="1.0" encoding="utf-8" ?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>cr</Title> | |
<Shortcut>cr</Shortcut> | |
<Description>Code snippet for Console.ReadLine</Description> | |
<Author>Whoever you want it to be</Author> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> |
This file contains 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 static class ConsoleExtension | |
{ | |
public static void ToConsole<T>(this IEnumerable<T> s, string header) | |
{ | |
Console.WriteLine($"*********BEGIN {header}**************"); | |
foreach (T item in s) | |
{ | |
Console.WriteLine(item); | |
} | |
Console.WriteLine($"*********END {header}**************"); |
This file contains 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.Data.Entity; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace linq_ORM_entities | |
{ | |
public static class CustomExtentions |
This file contains 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 interface Girl | |
{ | |
void check(); | |
} | |
class Vietnamese : Girl | |
{ | |
public void check() | |
{ | |
Console.WriteLine("Girl from Vietnam"); | |
} |