locked
Domain Service Class problem RRS feed

  • Question

  • Hi guys I'm trying to make this code work, just getting to Silverlight again.

    I'm using an ADO.NET Data Entity Model and Domain Service Class with generated metadata classes. When I go to define bmc what I'm looking for in the Intelli-sense should be DomainServiceMultiContext or something like that but its not there. The DomainServiceMulti I have in place now is making a new instance of itself and won't pass the data onto the datamapper but its a place holder. Any ideas? Something I've done wrong? Which I probably have Smile.

             public void LoadScheduler()
            {
                DomainServiceMulti bmc = new DomainServiceMulti();

                DataMapper mapperAppointment2 = new DataMapper();
                mapperAppointment2.Mapping.Add("Uid", "id");
                mapperAppointment2.Mapping.Add("Start", "StartDate");
                mapperAppointment2.Mapping.Add("Finish", "FinishDate");
                mapperAppointment2.Mapping.Add("ResourceUid", "UsrId");
                mapperAppointment2.Mapping.Add("Subject", "Subject");
                multiScheduler.AppointmentDataAdapter = new RiaDataAdapter(bmc, bmc.multischedulers, "GetMultischedulersQuery", mapperAppointment2);

                DomainServiceUsers bmcusers = new DomainServiceUsers();

                DataMapper mapperResources = new DataMapper();
                mapperResources.Mapping.Add("Uid", "id");
                multiScheduler.ResourceDataAdapter = new RiaDataAdapter(bmcusers, bmcusers.Users , "GetUsers1Query", mapperResources);

                multiScheduler.AppointmentDataAdapter.DataLoaded += new EventHandler<EventArgs>(AppointmentDataAdapter_DataLoaded);
                multiScheduler.AppointmentDataAdapter.LoadData();
            }

            void AppointmentDataAdapter_DataLoaded(object sender, EventArgs e)
            {
                multiScheduler.ResourceDataAdapter.LoadData();
            }

     

    Sunday, June 20, 2010 11:16 AM

Answers

  •  I came back the next day and saw the that I'd made a mistake the first line should have been:

     var ds = new DomainServiceMulti();
    Friday, June 25, 2010 1:47 PM

All replies

  • Hi,

        where are you writing this block of code, in the asp.net page code-behind?

        If this is the case, then no domain context is available.

        If you are using silverlight client, you can watch this.

        http://www.silverlight.net/learn/videos/all/net-ria-services-intro/

    Best Regards

    Tuesday, June 22, 2010 5:36 AM
  •  I came back the next day and saw the that I'd made a mistake the first line should have been:

     var ds = new DomainServiceMulti();
    Friday, June 25, 2010 1:47 PM