Insert, Update and Delete methods of RIA Services are invisible under WPF Client to RIA Services

I really cannot figured out why under the WPF client to RIA Services I cannot see methods to Update, Insert and Delete. But I can see all "GET" methods only.

RiaService.DomainServicesoapClient proxy = new RiaService.DomainServicesoapClient( EndPointConfigurationNameData, EndpointAddress);

proxy.GetClients(); // That's OK

// But where is  ????
proxy.UpdateClient(...

The code below has been generated by Visual Studio 2010.

[RequiresAuthentication]
[EnableClientAccess()]
public class RiaDomainService : LinqToEntitiesDomainService<MyEntities>
{
   .....
// TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Clients' query.
        [Query(IsDefault = true)]
        public IQueryable<Client> GetClients()
        {
            return this.ObjectContext.Clients;
        }

        public void InsertClient(Client client)
        {
            if ((client.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(client, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Clients.AddObject(client);
            }
        }

        public void UpdateClient(Client currentClient)
        {
            this.ObjectContext.Clients.AttachAsModified(currentClient, this.ChangeSet.GetOriginal(currentClient));
        }

        public void DeleteClient(Client client)
        {
            if ((client.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(client, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Clients.Attach(client);
                this.ObjectContext.Clients.DeleteObject(client);
            }
        }

So CRUD methods not getting recognized by the RIA context... Any clue how to get it under the client side

UPDATES:

I found that this code works like a CRUD

RiaService.ChangeSetEntry changeSetEntry = new RiaService.ChangeSetEntry();
changeSetEntry.Entity = {entity itslef};
changeSetEntry.Operation = RiaService.DomainOperation.Insert;
changeSetEntries.Add(changeSetEntry);

proxy.SubmitChanges(changeSetEntries.ToArray());

My question then: Are there any other methods to realize CRUD operations under WPF client to RIA Services?

Answers


Based on your updates it looks like you've already found the following article, but I'm posting in case someone else might find it interesting as I believe it contains the information you're looking for:

http://blogs.msdn.com/b/davrous/archive/2010/12/03/how-to-open-a-wcf-ria-services-application-to-other-type-of-clients-the-soap-endpoint-3-5.aspx


Need Your Help

CakePHP 2.5.1 Number helper does not show currency symbol 'after'

php cakephp number-formatting cakephp-2.5

I tried to set up a number format for living space in Cakephp, it should look like this: "100,00 m²"

Pass Model as a list from View to Controller using ajax call

c# asp.net ajax asp.net-mvc-4

I have trouble trying to send my entire model which actually is a List&lt;Account&gt; using ajax call.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.