View UrlRedirectTracer.cs
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Xml.Linq; | |
namespace RedirectTracer | |
{ | |
class Program |
View Temp_SampleCode.cs
var names = new List<String> | |
{ | |
"Ana", | |
"Felipe", | |
"Emillia" | |
}; | |
names.ForEach(name => | |
Console.WriteLine($"Hello {name}")); |
View Lab1.cs
using System; | |
namespace ConsoleApplication2 | |
{ | |
public class Program | |
{ | |
public static void Main() | |
{ | |
int mark = 66; |
View Demo.cs
using Microsoft.EntityFrameworkCore; | |
using Microsoft.EntityFrameworkCore.Internal; | |
using Microsoft.EntityFrameworkCore.Metadata; | |
using Microsoft.EntityFrameworkCore.Storage; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Logging; | |
using System; | |
using System.ComponentModel.DataAnnotations.Schema; | |
using System.Linq; |
View Demo.cs
using System; | |
using System.Data.Entity; | |
using System.Linq; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
private static string connection_one = "Server=(localdb)\\mssqllocaldb;Database=Blogging_One;Trusted_Connection=True;"; | |
private static string connection_two = "Server=(localdb)\\mssqllocaldb;Database=BLogging_Two;Trusted_Connection=True;"; |
View Demo.cs
protected override void OnModelCreating(ModelBuilder modelBuilder) | |
{ | |
var dbSets = GetType().GetProperties() | |
.Where(p => p.PropertyType.Name == "DbSet`1") | |
.Select(p => new | |
{ | |
PropertyName = p.Name, | |
EntityType = p.PropertyType.GenericTypeArguments.Single() | |
}) | |
.ToArray(); |
View Demo.cs
using System; | |
using System.Collections.Generic; | |
using System.Data.Common; | |
using System.Data.Entity; | |
using System.Data.Entity.Infrastructure.Interception; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
namespace Demo |
View Demo.cs
protected override void OnModelCreating(ModelBuilder modelBuilder) | |
{ | |
foreach (var entity in modelBuilder.Model.GetEntityTypes()) | |
{ | |
modelBuilder.Entity(entity.Name).ToTable(entity.Name + "s"); | |
} | |
} |