locked
Sava data on WCF RIA DataWorkspace RRS feed

  • Question

  • Hello to all,

    I have the follow problem: I have a DataSource (GiriDataServiceData2) coming from a WCF RIA service using POCO entities.

    In a screen based on the table/query of this DataSource I make some modification and I'd like to apply those.

    myapp.applyChanges seems not useful and I expected that LS call my CRUD WCF RIA methods..

    Some one can help me? THANKS!!

    Here an example of my CRUD Methods



    • Edited by lunardbz Thursday, December 12, 2013 4:45 PM
    Thursday, December 12, 2013 4:33 PM

Answers

  • OK, I found the answer..my error:

    • Marked as answer by lunardbz Friday, December 13, 2013 8:42 AM
    Friday, December 13, 2013 8:41 AM

All replies

  • Here I show thet a entity is changed!!!

    Friday, December 13, 2013 8:35 AM
  • OK, I found the answer..my error:

    • Marked as answer by lunardbz Friday, December 13, 2013 8:42 AM
    Friday, December 13, 2013 8:41 AM
  • I changed the approach of my application and now I call a query on the client side to load data on the AddEdit screen, instead add and use this query IN THE screen.

     myapp.activeDataWorkspace.GiriDataServiceData2.GetGiroDataByIdGiro(screen.Percorsi.selectedItem.Id).execute().then(function (data) { // Richiama la query del WCF RIA e mi faccio ritornare i giri (ce ne sara' solo 1!)
                myapp.showAddEditGiroEntity1(data.results[0], {
                    beforeShown: function (addNewScreen) {
                        // todo
                    },
                    afterClosed: function (closeNewScreen, action) {
                        if (action === msls.NavigateBackAction.commit) {
                            // Update the Grid//
                            screen.Percorsi.load();
                        }
                    }
                });
            });

    But now I have a strange behavior: the child of GiroEntity, Tappe (IQuerable<TappaEntity) seems to be empty, BUT the query in the WCF RIA returns 3 TappaEntity, as shown in figure:

    Friday, December 13, 2013 10:13 AM
  • Maybe the association in the DataService is wrong??

    public class GiroEntity
        {
            [Key(), Editable(false)]
            public int IdGiro { get; set; }
    
            [Required(ErrorMessage = "La descrizione del giro e' obbligatoria"), Editable(false), StringLength(50)]
            public string DescrizioneGiro { get; set; }
    
            [Include]
            [Association("AssocTappe", "IdGiro", "ParentId", IsForeignKey = false)]        
            //[Required(ErrorMessage = "Per il giro devono essere definite delle tappe")]
            public IQueryable<TappaEntity> Tappe { get; set; }
        }

    Friday, December 13, 2013 10:15 AM
  • Hi lunardbz

    Glad to hear that you have solved this issue by yourself, and it is very appreciated to share your solution to us. It will be helpful for other community members who have similar issues. :)

    Best regards

    Angie


    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 9:13 AM