Hello My Program got this error and i dont know why?
Since 'InsertToHomeSecondPagesTableJob.Execute(IJobExecutionContext)' is an async method that returns 'Task', a return keyword must not be followed by an object expression. Did you intend to return 'Task'?
this is my code
public async Task Execute(IJobExecutionContext context)
{
var PagesScoreNewsHomePageTable = new PagesScoreNewsHomePageTable()
{
PagesID = 1,
UserID = 22,
Author = "jack"
};
_db.AddAsync(PagesScoreNewsHomePageTable);
_db.SaveChangesAsync();
return Task.CompletedTask;
}
how can i solve this error?