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 implement_program_flow | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
//C# relational and equality operators | |
const int mySalary = 1000; | |
const int anonSalary = 1500; |
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 implement_program_flow | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var falseValue = false; | |
var trueValue = true; | |
Console.WriteLine(falseValue || trueValue); |
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 implement_program_flow | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var coffee = true; | |
var isDeadlineClose = false; | |
if (coffee) | |
{ |
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 implement_program_flow | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// Null-coalescing operator | |
var words = new[] { "Luis", "Felipe", "Jorge", "Joel", "Helora" }; | |
var richardName = words.SingleOrDefault(w => w == "Richard") ?? "Default"; // FirstOrDefault returns null if there is no "Richard" |
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 implement_program_flow | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// The Switch Statemenet | |
var rankingPosition = 1; | |
switch (rankingPosition) |
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
Home.cshtml | |
@using WebApplication3.Controllers | |
@model WebApplication3.Controllers.Conta | |
@{ | |
ViewBag.Title = "Novidade do ASP.NET MVC 5"; | |
string nomeDiaSemana = Model.DiaDaSemana.GetDescription(); | |
} |
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.Xml; | |
using System.Xml.Serialization; | |
namespace XmlExemploDevMedia | |
{ | |
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
using System; | |
namespace create_implement_events_callbacks | |
{ | |
class Program | |
{ | |
public delegate int Calculate(int x, int y); | |
public static int Add(int x, int y) | |
{ |
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; | |
namespace create_implement_events_callbacks | |
{ | |
class Program | |
{ | |
public delegate void Calculate(int x, int y); | |
public static void Add(int x, int y) | |
{ |
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; | |
namespace create_implement_events_callbacks | |
{ | |
class Program | |
{ | |
public delegate int Calculate(int x, int y); | |
public delegate void ShowMessage(string message); | |
static void Main(string[] args) |