BroodWar1989
BroodWar1989
CC#
Created by BroodWar1989 on 1/20/2023 in #help
Entity Framework not creating tables
thanks so much
30 replies
CC#
Created by BroodWar1989 on 1/20/2023 in #help
Entity Framework not creating tables
perfect i will check it out and msg here if i have problems
30 replies
CC#
Created by BroodWar1989 on 1/20/2023 in #help
Entity Framework not creating tables
can i rollback to a specific migration
30 replies
CC#
Created by BroodWar1989 on 1/20/2023 in #help
Entity Framework not creating tables
How can I rollback migrations to a previous migration and try to fix from there. I am still getting the same error
30 replies
CC#
Created by BroodWar1989 on 1/20/2023 in #help
Entity Framework not creating tables
Ok I will add it but it was working on other classes without adding the
[Key]
[Key]
attribute. I will see if it fixes.
30 replies
CC#
Created by BroodWar1989 on 1/20/2023 in #help
Entity Framework not creating tables
but now when using Genre inside Movie as a property I get this error
30 replies
CC#
Created by BroodWar1989 on 1/20/2023 in #help
Entity Framework not creating tables
the migration worked and created the proper table
30 replies
CC#
Created by BroodWar1989 on 1/20/2023 in #help
Entity Framework not creating tables
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace web_template_001.Models
{
public class Genre
{
[Required]
public int Id { get; set; }
[Required]
public string Name { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace web_template_001.Models
{
public class Genre
{
[Required]
public int Id { get; set; }
[Required]
public string Name { get; set; }
}
}
30 replies
CC#
Created by BroodWar1989 on 1/20/2023 in #help
Entity Framework not creating tables
30 replies
CC#
Created by BroodWar1989 on 1/20/2023 in #help
Entity Framework not creating tables
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_dbo.Movies_dbo.Genres_GenreId". The conflict occurred in database "aspnet-web_template_001-20230102051540", table "dbo.Genres", column 'Id'.
30 replies
CC#
Created by BroodWar1989 on 1/20/2023 in #help
Entity Framework not creating tables
@Angius I have another issue now. When trying to reference a model in another model i am getting this error
30 replies
CC#
Created by BroodWar1989 on 1/20/2023 in #help
Entity Framework not creating tables
thank you
30 replies
CC#
Created by BroodWar1989 on 1/20/2023 in #help
Entity Framework not creating tables
found it, ok I will add it to dbset
30 replies
CC#
Created by BroodWar1989 on 1/20/2023 in #help
Entity Framework not creating tables
😦
30 replies
CC#
Created by BroodWar1989 on 1/20/2023 in #help
Entity Framework not creating tables
Ah ok I understand. I forgot where dbcontext was because I have been referencing other models in models that are in dbcontext
30 replies
CC#
Created by BroodWar1989 on 1/20/2023 in #help
Entity Framework not creating tables
it was reading my model changes automatically
30 replies
CC#
Created by BroodWar1989 on 1/20/2023 in #help
Entity Framework not creating tables
I haven't needed to manually add them into dbcontext since my first couple tables
30 replies
CC#
Created by BroodWar1989 on 1/20/2023 in #help
Entity Framework not creating tables
Let me check real quick
30 replies