Skip to content

Instantly share code, notes, and snippets.

💭
Software Development is my passion!

Carlos dos Santos carloscds

View GitHub Profile
View ExemploStringRange.cs
string str = "Exemplo em C# 8";
string palavra = str[^4..^0];
Console.WriteLine(palavra);
string final = str[^4..];
Console.WriteLine(final);
string inicio = str[..7];
Console.WriteLine(inicio);
View fromend.cs
static void Main(string[] args)
{
string str = "Exemplo em C# 8";
foreach(var s in str[^4..str.Length])
{
Console.Write(s);
}
Console.WriteLine("");
}
View program.cs
static void Main(string[] args)
{
int[] num = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
foreach(int i in num[1..5])
{
Console.WriteLine(i);
}
}
View program.cs
static void Main(string[] args)
{
int[] num = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
foreach(int i in num)
{
Console.WriteLine(i);
}
}
View Program_NoTracking.cs
var db = new Contexto();
var dados1 = new Dados(db);
var cat = dados1.GetNoTracking(1);
Console.WriteLine(cat.CategoryName);
View Dados.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EFAsNoTracking
{
public class Dados
{
View Program2.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EFAsNoTracking
{
class Program
{
View Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EFAsNoTracking
{
class Program
{
View Dados.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EFAsNoTracking
{
public class Dados
{
View Contexo.cs
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EFAsNoTracking
{
public class Contexto : DbContext
You can’t perform that action at this time.