IUpdatable을 구현하려고합니다.인터페이스 구현시 오류 : 클래스가 인터페이스 멤버를 구현하지 않습니다.
오류 '1 WebRole1.InfoManager'가 'System.Data.Services.IUpdatable.ClearChanges()'인터페이스 멤버를 구현하지 않습니다. 모든 오류는 모든 인터페이스 멤버를 구현하고 있지는 않지만 일부는 구현하고 있습니다. 물론 전부는 아닙니다. 나는 당신이 이해할 수 있기를 바란다.
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
}
}
}
그래, 내가 몇 가지 방법이 필요하면 내가 NotImplementedException 인상 할 수있는, 그 빠른, 감사합니다. –
그것이 올바른 접근법 인 반면, 들어가는 것은 좋은 습관이 아닙니다. 동료로서 항상 모든 메소드가없는 인터페이스를 구현하는 이유에 대해 항상 궁금해합니다. 인터페이스가 그러한 구현이 허용되는 경우를 제외하고는 본질적으로 거짓말입니다. – jdmichal
빨리 원한다면 자동 업데이트를위한 업데이트를 참조하십시오. 만약 당신이 그것을 손으로하고 싶다면 메소드 바디를 정의하고 예외 발생을 생략하는 것이 _ throwing_ a throw보다 빠를 것이다. –