.net - How to use entity framework inheritance? -
First of all I am a noob so please be gentle :-) I have a base object company. I want to get in the vendor object. My problem begins with the fact that a given company can be a customer and a seller at the same time. In all instances, I have seen the use of the property of the company and kept it near the customer or vendor, but I can not do this.
For clarity (for I hope) editing.
stijn
Here's a simplified version of what I'm working on. I have three tables that are described in my DB. I have modeled in Visual Studio and have created and tested associations between tables (on Company ID) and treats everything as expected. When I remove the associations and inherit from the customer and the seller receives a lot of errors from the company. My impression: The company can be an item or inherited by the customer or the seller. A given company can be both a customer and a vendor.
I am very new to the structure of the institution, I started working with it almost two weeks ago and still trying to understand the more advanced (for me) parts. Am I taking the whole direction, or am I missing something important now?
Company - IID - Name - Address - City - ATC
Customer - chemist id - Cooper - specific field - Company ID
Seller - Vendor ID - Win - specific field -companyID
Andrew Wein
In my first attempt I was able to interact with the seller by creating an object and then asking for an example (the correct word I think) And I'm using this vendor. Companie Address = "123 Help Trails" Instead of what I want to be able to do is the seller. Address = "123 Happy Trails" using inheritance.
Thank you for both of you in trying to help.
I resolved the problem I was using an existing database in which all of the tables I use While trying to do, the automatic increment in them was the primary key, they needed to stop auto increment and 1: 1 relationships were defined in the database. Once I made these changes, then I wanted to behave as I wanted.
T
Comments
Post a Comment