locked
one .dbml per table? RRS feed

  • Question

  • This is probably a really stupid question, but do I need to create a new WCF service for each table in the database or do I put all the tables in the same .dbml file? I'm a newbie when it comes to C# too, so I haven't really learned how things are structured.

     /deslo
     

    Thursday, May 29, 2008 6:43 AM

Answers

  • Hi:

     

    do I need to create a new WCF service for each table in the database or do I put all the tables in the same .dbml file?

      You can put the tables you need in one .dbml if these tables have relations. If they have no relations you can either put them in different .dbml or in one dbml. As to the WCF operation contract it really depends. If you can get it work with one operation contract you don't have to add other operation contracts. In this case you may pass the data table name and other useful parameters to the method. If not or you find the logic is too complex in a single method or you need to apply different attributes for any specific operation contract you can split it to several methods.


    Regards

    Sunday, June 1, 2008 10:11 PM

All replies

  • Hi:

     

    do I need to create a new WCF service for each table in the database or do I put all the tables in the same .dbml file?

      You can put the tables you need in one .dbml if these tables have relations. If they have no relations you can either put them in different .dbml or in one dbml. As to the WCF operation contract it really depends. If you can get it work with one operation contract you don't have to add other operation contracts. In this case you may pass the data table name and other useful parameters to the method. If not or you find the logic is too complex in a single method or you need to apply different attributes for any specific operation contract you can split it to several methods.


    Regards

    Sunday, June 1, 2008 10:11 PM
  • Thanks! 

    Monday, June 2, 2008 2:42 AM