Hello guys, i have a big problem. I am developing webapp for API in Blazor-server.
When i send normal message like:
"Show me example how to use Generic methods"
it works but if i go with snippet like this:
"
Does this code follow best practices:
#region SearchBox
public string SearchTerm { get; set; } = string.Empty;
public List<PostEntity> FilteredPosts = new List<PostEntity>();
public async Task FilterPosts()
{
await Task.Delay(0);
if (!string.IsNullOrWhiteSpace(SearchTerm))
{
FilteredPosts = Posts
.Where(x => x.Title.ToLower().Contains(SearchTerm.ToLower())).ToList();
}
else
{
FilteredPosts = new();
}
}
#endregion
"
i get this error response:
"StatusCode: BadRequest, Content-Type: application/json, Content-Length: 476)"
I should format this text somehow? I cannot find information about this anywhere..