Skip to main content

All Questions

0 votes
0 answers
112 views

Entity Framework Core : model schema one-to-many relationship

I am used to building a database and accessing data through tables, views, and stored procedures. In this case I have to build the database using Entity Framework Core migrations. My database schema ...
Stephen Lee Parker's user avatar
1 vote
1 answer
343 views

How to model users and post addresses to find the city by zip code?

I want to be able to load the city as related data on a user, based on the user's zip code. I understand that it not recommended to use the zip code itself as a key, as it might change in the future. ...
Stian's user avatar
  • 1,612
0 votes
1 answer
30 views

EF code first - Cycles or multiple cascade paths

I'm making a voting system. A Poll can have any number of PollOptions. A Vote can be blank (null on PollOptionId). My models: public class Poll { public Guid Id { get; set; } public List<...
Stian's user avatar
  • 1,612
-1 votes
1 answer
47 views

Can I have a database table without PK if I know there will only ever be one record in that table?

I am making a web app, and one of the db tables holds client information and design settings for the site: public class Client { public string Name { get; set; } public string SiteName { get; ...
Stian's user avatar
  • 1,612
0 votes
3 answers
227 views

How to Create two Foreign Keys in one Table pointing to the same Column in some table?

I have a database design I want to implement, which is hard and make the error "there were multiple ForeignKeyAttributes which are pointing to same set of propertie" we have an airport and flights, a ...
Mina Ghaly's user avatar
0 votes
1 answer
636 views

Creating different tables using using same base abstract class

I have 2 models which have exactly same fields, but I chose to make different models for them because I needed two different tables, one for each. Earlier everything was working fine when I had two ...
user avatar
1 vote
2 answers
1k views

How to code (first) the following ternary relationship in MVC Entity Framework C# with fluent API?

UPDATE It seems I did not make my self understood. I might have chosen the problem incorrectly. So I will try with another example which hopefully will illustrate better my problem. New example: Dog ...
MikeMajara's user avatar
0 votes
0 answers
39 views

Entity Framework 6 Design Architecture For Images

The point is: I use EF6 and have 2 entities which may have some connected images, but these entities are not connected with any hierarchy (e.g EntityA, EntityB). These images may exist in different ...
frninja's user avatar
1 vote
0 answers
679 views

Should I use Guid or Int as Primary Key (Entity Framework 6) [duplicate]

I know this question is asked alot, but I still can't decide which one is better for me. In my system I have a table of Emails. New emails are created often, the ones that exist are deleted often, ...
user avatar
0 votes
1 answer
92 views

Entity framework virtual navigation property

I develop web application using EF6. Say I have the following models: public interface IBaseEntityObject { public int Id {get; set;} } public abstract class BaseEntityObject : IBaseEntityObject ...
user avatar
0 votes
1 answer
312 views

Entity Framework - How to avoid TPC in a class hierarchy

In my business domain I have two entities which, as objects, defines a hierarchical relationship according to the properties they expose but that at the Data Base level they are very different. ...
mdarefull's user avatar
  • 1,049
3 votes
2 answers
2k views

EF6 code first multiple 1-to-many mapping issue / "Multiplicity" error

I am receiving the following error when attempting to create the database: One or more validation errors were detected during model generation: Interaction_CauseElement_Source: : Multiplicity ...
jwatts1980's user avatar
  • 7,364
0 votes
1 answer
126 views

Store list of pairs in one table EF

I used the following class: public class Point { [Required] public double X { get; set; } [Required] public double Y { get; set; } } And the Model containing: public List<Point>...
Amirhossein Mehrvarzi's user avatar
2 votes
1 answer
1k views

EF Code-First inherit a single base class to implement easy historocity

I am running into some errors implementing my plan as described below. I am not so interested at this point in resolving particular errors as I am in whether or not this is a good idea. All history-...
tacos_tacos_tacos's user avatar
0 votes
2 answers
321 views

ASP Entity Framework - Code FIrst - Data Design - Keys

I am attempting to structure my database appropriately for my web application. I am unsure the correct way to proceed with the keys and relationships. Basically.. My project contains a Product Which ...
scniro's user avatar
  • 17k

15 30 50 per page