locked
Passing Non Entity Parameters to Stored Procedure RRS feed

  • Question

  • I want to Pass Non Entity Parameters to Stored Procedures. Actually I have 3 Tables in Database. Table 1: Contact -> ContactID, Name Table 2: Images-> ImageId, Image and Table 3 ContactsImages: ContactId,ImageId,isDefault.

    Now when I Insert/Update Contact I also want to update other 2 tables and I want to do it with Stored Procedure to avoid server trips. To Serve above purpose I need to pass almost all the parameters from all three tables. But I dont know how to do it in Entity Framework. I tried to create New Model with All the Parameters But I don't have table to map the Model.  Can anyone please show me the solution or is there any work around to solve this.

    thanks for your time and help...

    Sunday, January 8, 2012 12:22 AM

Answers

  • For many to many relationship, there is a M2M4RIA on codeplex which simplify many-to-many relationship in ria service. 

    Then there are only two models Contact and Images. When adding a new record it will looks like

    Contacts.Images.Add(new Image(){....})

    It makes crud much easier.

    Hope it helps.

    Tuesday, January 10, 2012 10:58 AM