I have the following interface:
public interface ISapFunction
{
void Import<T>(T obj);
T Export<T>();
void Call(RfcRepository repo, RfcDestination dest);
}
and then I try to implement it as follows:
public class SapMaterialFormatter : ISapFunction
{
private static SapMaterialFormatter _self;
private string _formatted;
private string _raw;
private SapMaterialFormatter()
{
}
public void Import<string>(string obj)
{
_raw = obj;
}
public string Export<string>()
{
return _formatted;
}
public void Call(RfcRepository repo, RfcDestination dest)
{
var bapi = repo.CreateFunction("FUNCTION");
bapi.SetValue("IF_INPUT", _raw);
bapi.Invoke(dest);
_formatted = bapi.GetString("EF_OUTPUT");
}
public static SapMaterialFormatter Factory()
{
return _self ?? new SapMaterialFormatter();
}
}
But the compiler complains, generating syntax errors:
What is wrong with the implementation?