First of all, let me apologize because I know my question will be very confusing since my English is pretty bad.
I am working on a project for a company, mainly create a system to take care for their good, using MVVM C#
My MS SQL database looks like this
So I have auto-increment for both Bike-id and Contact-id. Each time I want to retrieve database from 3 tables, I have to make a join with Linq then get data using webservice, pretty complicated since I can use Lambda for toffee. It works but it messed up.
Furthermore, it is getting more complicated when I want to create bikes from a Contact, I dont want to tell people "hey each time you create a bike, you have to give me a ContactId". Im currently using .Max() or .First() to get a most recent ID, but then it is not flexible. How could I implement that when people click on a List of Contact, if they want to use a contact for creating a new bike, they can just click on a button, the system will know they have chosen that ContactId?
Also, when people create a new bike, I will let them go to the page with full of text box to fill out, of course there could be a new ContactId with a new items, but they are 2 different tables, how do I let it know that I am creating an Item for this ContactId.
Again, Im sorry to confuse you guys since my question it is very unpercisely. But please help me out of this.