C
C#15mo ago
zita epsilon

❔ I can't create migration

8 Replies
zita epsilon
zita epsilon15mo ago
Can anyone help me please?
Pobiega
Pobiega15mo 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
zita epsilon
zita epsilon15mo 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
Pobiega15mo ago
your project isn't compiling stop worrying about the database. check your error list
zita epsilon
zita epsilon15mo 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
Pobiega15mo ago
There you go.
zita epsilon
zita epsilon15mo ago
thanks for the advice ❤️
Accord
Accord15mo 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
More Posts