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
protected override void OnModelCreating(ModelBuilder modelBuilder) | |
{ | |
foreach (var entity in modelBuilder.Model.GetEntityTypes()) | |
{ | |
modelBuilder.Entity(entity.Name).ToTable(entity.Name + "s"); | |
} | |
} |
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.Common; | |
using System.Data.Entity; | |
using System.Data.Entity.Infrastructure.Interception; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
namespace Demo |
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
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(); |
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.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;"; |
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 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; |
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; | |
namespace ConsoleApplication2 | |
{ | |
public class Program | |
{ | |
public static void Main() | |
{ | |
int mark = 66; |
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
var names = new List<String> | |
{ | |
"Ana", | |
"Felipe", | |
"Emillia" | |
}; | |
names.ForEach(name => | |
Console.WriteLine($"Hello {name}")); |
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.IO; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Xml.Linq; | |
namespace RedirectTracer | |
{ | |
class Program |