I have the following method in my code, which takes a Guid as a parameter. I want to override this method with one that takes a string as a parameter:
public class SendEmailApi: ISendEmailApi
{
public async Task<EmailTemplate> GetTemplateByIdAsync(Guid templateId)
{
var response = await _emailClient.RequestAsync(EmailClient.Method.GET, urlPath: $"templates/{templateId}");
return JsonConvert.DeserializeObject<EmailTemplate>(await response.Body.ReadAsStringAsync());
}
}
However when I try to implement, I get the error that there is no suitable method to override.
public async override Task<EmailTemplate> GetTemplateByIdAsync(string templateId)
{
var response = await _emailClient.RequestAsync(EmailClient.Method.GET, urlPath: $"templates/{templateId}");
return JsonConvert.DeserializeObject<EmailTemplate>(await response.Body.ReadAsStringAsync());
}
The interface looks like this:
public interface ISendEmailApi
{
Task<EmailTemplate> GetTemplateByIdAsync(Guid templateId);
}
I am relatively new to C# and .NET and any advice would be appreciated - I am sure I am missing something obvious? Thanks