I currently have a controller in my WebAPI that is returning a list of some items in my database:
As below:
public ICollection<TherapyGroup> OffUnit()
{
return _context.TherapyGroups.OrderBy(g => g.Name)
.Where(x => x.GroupTypeOffUnitOnUnit == TherapyGroup.OffUnit)
.ToList();
}
Everything works fine when I am testing against my local database; however, when I switch out the database string for a remote database it throws a System.AccessViolationException. Based upon breakpoints, the data is being returned from the database fine, and it seems the problem is happening when the method returns to the WebApi in MVC. This has become a very frustrating issue, and I would love any help to navigate it.