entity framework - How to map Tuple<something, something> to database using c# EF code first? -


i've been searching , can't find solve problem, here part of code:

namespace domain {     public class assessment     {         //other props         public list<tuple<user, int>> usersmeanttosolvethisalongwithtimeeachspentonit { get; set; }     } } 

when modify database using migrations mapped correctly, simple props "assessments" table perfectly, , props use other entities in "many many" way, correctly mapped new tables after using fluent api.

yet don't know how map list of tuples... ideas?

well, came solution, if has same problem, ended doing this:

1 - created new class

public class userandtimehespentonsolvingassessment {     public int id { get; set; }     public user usersolvingtheassessment { get; set; }     public int timespentbyusertosolvetheassessment { get; set; } } 

2 - update disturbing property

public list<userandtimehespentonsolvingassessment> usersmeanttosolvethisalongwithtimeeachspentonit { get; set; } 

it worked, yet still have doubt mapping tuples, if knows answer welcome :d


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -