none
How to use a Domain Service to insert a DB record without Silverlight RRS feed

  • Question

  • Greetings,

    I have a domain service (ds1) that is creating and populating an object.

    I have another domain service (ds2) that contains the CRUD logic to insert that object type into my table.

    In "ds1" I want to create an instance of "ds2", pass my object to the insert method and insert to my DB table.

    Not sure how to do this. 

    Here is my code in "ds1" to try this.  It runs without error but the new record does not make it to the DB table:

                ds1 svc = new ds1();
    
                Object myObj = new Object();
    
                myObj.Address = "MyAddress";
                myObj.Date = "12/12/2013";
    
                svc.InsertMyObj(myObj);
    

    Any help would be greatly appreciated!


    Best, CM+

    Friday, December 13, 2013 7:15 PM

Answers

  • Hello,

    >> It runs without error but the new record does not make it to the DB table:

    Have a try to profile/trace the database then we can inspect the insert query and get an idea why it is failing.

    Or please make sure that whether other operations would be ok or not.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, December 16, 2013 3:10 AM
    Moderator