locked
need help with entity frame work RRS feed

  • Question

  • User-1566284277 posted

    hi everyone how are you?

    i need you help urgently

    now in database i have 4 tables connected with each other (unions, users, nominee, votes)

    the requirement is make page contain report of details as following:

    union names the users that belong to that union nominee that belong to that union vote title in that union

     so as you see all related to just unions not related to each other so if i delete some users names suppose not to delete the recored just delete name of deleted users without make space cell in table and also in case of insertion how can i add from more than table

    how can i say that i want user names column from users table give data to user name column in report table 

    (and sure this for all other tables(nominee, votes)

    i want entity frame work code deal with columns only not all record (like list do )

    can you please help me with that

    Monday, March 15, 2021 9:11 AM

All replies

  • User475983607 posted

    The community needs at least the entity design to assist with writing a LINQ query.   Designing navigation properties and writing LINQ queries is covered in ever beginning level tutorial.  

    https://docs.microsoft.com/en-us/ef/ef6/get-started

    i want entity frame work code deal with columns only not all record (like list do )

    Can you share code that illustrates this issue?  

    Monday, March 15, 2021 11:25 AM
  • User-1566284277 posted

    it is just like you make selection columns from tables have inner-join between them and put date in there foreign key in the new table 

    so it will be like select user_id, union_id from Users and insert them in report_unionid, report_userid

    select nominee_id where(union_id==report_unionid) from from nominee and insert them in report_nomineeid

    select vote_id where(union_id==report_unionid) from from vote and insert them in report_voteid

    Monday, March 15, 2021 11:44 AM
  • User475983607 posted

    You are asking Entity Framework fundamentals that are found in every beginning level tutorial.  Also, it seem you are asking how to design as application feature with unclear requirements.

    samaremad

    so it will be like select user_id, union_id from Users and insert them in report_unionid, report_userid

    You ask this question as if the community can see your code.  It is not clear why you are unable to write a simple LINQ query or set a property.  Share the entity design and sample code that illustrates the problem you are having.  You need to provide enough code so the community can reproduce this issue.  

    Still, I recommend going through a few tutorials before moving forward.

    Monday, March 15, 2021 11:56 AM