Error during interface implementation: the class does not implement interface elements

I am trying to implement IUpdatable.

Error 1 'WebRole1.InfoManager' does not implement the interface member 'System.Data.Services.IUpdatable.ClearChanges ()' All the errors that I get say that I do not implement all the members of the interface, but I do not implement some, of course. I did not put the hole code, I hope you understand.

  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Data.Services;
  using Microsoft.WindowsAzure;
  using Microsoft.WindowsAzure.ServiceRuntime;
  using Microsoft.WindowsAzure.StorageClient;

  namespace WebRole1
  {
     public class InfoManager : IUpdatable
     {
      private TableServiceContext context;

    // To Generate DataConnectionString and svcClient
    private TableServiceContext GetContext()
    {
    //Implemented code
    }

    public CommentManager()
    {
        context = GetContext();
    }


    // To get my table infos
    public IQueryable<Info> Infos
    {
        get
        {
            return context.CreateQuery<Info>("Infos").AsTableServiceQuery();
        }
    }
   // Creating the resource and cheking the compatibility of the type and do an add Object 

    public Object CreateResource(string containerName, string fullTypeName)
    {
        //Implemented Code
    }

    // Return the instance of the resource represented by the object 
    public Object ResolveResource(Object resource)
    {
        return resource;
    }

    public void SaveChanges()
    {
        context.SaveChangesWithRetries();
    }

    public void setValue(Object targetResource, string propertyName, Object propertyValue)
    {
    //Implemented Code
    }

}

}

+3
source share
3 answers

This is an interface, so you MUST implement all members - whether you want to or not.

, ​​ . , , , , , NotImplementedException, , , .

( whys), , , , :

Visual Studio, , , VS ...

class MyClass : IMyInterface // <- hover mouse and click the drop down that appears

Implement Interface 'IMyInterface', ! .

+8

, . , . .

+1

I think the error is clear: you do not implement all the interface elements, which is required, of course.

+1
source

All Articles