C
C#2y ago
bLanco

❔ I can't create migration

8 Replies
bLanco
bLancoOP2y ago
Can anyone help me please?
Pobiega
Pobiega2y ago
your build is failing, meaning your code isnt even compilable atm fix that first. change to the "error list" window instead of Package manager console
bLanco
bLancoOP2y ago
using Microsoft.EntityFrameworkCore;

public class ExampleDBContext : DbContext
{
public DbSet<Product> Products { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer("Server=localhost,1433;Database=DenemeDB;User Id=Umut;Password=mypass
");
}
}

public class Product
{
public int Id { get; set; }


}
using Microsoft.EntityFrameworkCore;

public class ExampleDBContext : DbContext
{
public DbSet<Product> Products { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer("Server=localhost,1433;Database=DenemeDB;User Id=Umut;Password=mypass
");
}
}

public class Product
{
public int Id { get; set; }


}
So where is the bug, I can't see anything wrong?
Pobiega
Pobiega2y ago
your project isn't compiling stop worrying about the database. check your error list
bLanco
bLancoOP2y ago
Severity Code Description Project File Line Suppression State Error CS5001 Program does not contain a static 'Main' method suitable for an entry point CodeFirst C:\Users\Can\Desktop\CodeFirst\CodeFirst\CSC 1 Active hmm
Pobiega
Pobiega2y ago
There you go.
bLanco
bLancoOP2y ago
thanks for the advice ❤️
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server