How to perform a CRUD in C # with MySQL and ADO [closed]

1

I need to do the relationship between tables 1: N and N: N.

Table produto :

public int id {get; set;}
public string produto {get; set;}
public list<tamanhos> tamanhos {get; set;}

Table tamanhos :

public int produto_id {get; set;}
public string tamanho {get; set;}

Products can have numerous sizes. How to make a CRUD in MySQL in C # within this scenario? I know how to do all CRUD operations for isolated tables or 1: 1.

    
asked by anonymous 23.03.2016 / 04:39

1 answer

0

Lucas, in this case you will have to have a CRUD for Sizes, the Sizes must be registered before you try to register a Product. In product you will only do the reference with the sizes, in this case it will be a N: N relationship and in the database you will need a third table to maintain this relationship. In the Size table you will enter the sizes, then in the Products table you register the products and there should be a Products table where you will be informed the Product Id and Size Id, something like Sales and Sales Items, which is a well known example. / p>     

18.04.2016 / 14:28