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
Post a Comment