Stan
Stan
CC#
Created by Stan on 2/7/2023 in #help
❔ Error adding new model in EF Core
After dropping all tables and trying the migration again, everything seems to work as intended
8 replies
CC#
Created by Stan on 2/7/2023 in #help
❔ Error adding new model in EF Core
Also tried removing base.OnModelCreating(builder); but that gave me this error: The entity type 'IdentityUserLogin<string>' requires a primary key to be defined. If you intended to use a keyless entity type, call 'HasNoKey' in 'OnModelCreating'.
8 replies
CC#
Created by Stan on 2/7/2023 in #help
❔ Error adding new model in EF Core
I've tried placing the base.OnModelCreating(builder); which led to the same error
8 replies
CC#
Created by Stan on 2/7/2023 in #help
❔ Error adding new model in EF Core
might be worth noting, this is what my entire OnModelCreating looks like:
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);

builder.Entity<Ticket>()
.HasOne(x => x.Zitplaats)
.WithMany(x => x.Tickets)
.HasForeignKey(x => x.ZitplaatsId)
.OnDelete(DeleteBehavior.NoAction);
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);

builder.Entity<Ticket>()
.HasOne(x => x.Zitplaats)
.WithMany(x => x.Tickets)
.HasForeignKey(x => x.ZitplaatsId)
.OnDelete(DeleteBehavior.NoAction);
}
8 replies
CC#
Created by Stan on 2/7/2023 in #help
❔ Error adding new model in EF Core
just tried DeleteBehavior.NoAction which gave the same error
8 replies
CC#
Created by Stan on 1/29/2023 in #help
❔ EF Core tries to query a non-existant column for no apparent reason
thank you guys :)
21 replies
CC#
Created by Stan on 1/29/2023 in #help
❔ EF Core tries to query a non-existant column for no apparent reason
alright i got something working
21 replies
CC#
Created by Stan on 1/29/2023 in #help
❔ EF Core tries to query a non-existant column for no apparent reason
ill likely end up doing that with migrations yeah
21 replies
CC#
Created by Stan on 1/29/2023 in #help
❔ EF Core tries to query a non-existant column for no apparent reason
ah like that
21 replies
CC#
Created by Stan on 1/29/2023 in #help
❔ EF Core tries to query a non-existant column for no apparent reason
could you explain what's bad about this? this is just a column in the database relating each event to a bracket made in challonge.com
21 replies
CC#
Created by Stan on 1/29/2023 in #help
❔ EF Core tries to query a non-existant column for no apparent reason
This is the Game model:
public class Game
{
[Column("id")]
public int Id { get; set; }
public string Name { get; set; }

public List<Event> Events { get; set; }
}
public class Game
{
[Column("id")]
public int Id { get; set; }
public string Name { get; set; }

public List<Event> Events { get; set; }
}
21 replies