- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
Entity Framework/EFCore Returns Wrong Data (When Using FromSqlRaw)
You might find this short video useful if you're using the Entity Framework (EFCore) in .NET Core and you find out it's returning the wrong data.
This can happen for a number of reasons but in my particular case it was when I was using the FromSqlRaw method in C#. It seems particularly common if you're doing table joins (especially INNER JOINs).
To check you have the same problem, simply run the SQL query you're using in the FromSqlRaw method call in SQL Server itself. If the data in SQL Server Management Studio is correct but the wrong data is being returned from the Entity Framework then you have this issue.
The cause of the issue is described here: https://github.com/dotnet/efcore/issues/7917
The proposed solution is to tack on a call to AsNoTracking(). Just be sure to thoroughly test your code after you do so. This solution worked for me and I was fortunate the C# method with the error was only called once from our application.
Hope you found that useful - subscribe for more C# and SQL tutorials.
Видео Entity Framework/EFCore Returns Wrong Data (When Using FromSqlRaw) канала Coding With Brett
This can happen for a number of reasons but in my particular case it was when I was using the FromSqlRaw method in C#. It seems particularly common if you're doing table joins (especially INNER JOINs).
To check you have the same problem, simply run the SQL query you're using in the FromSqlRaw method call in SQL Server itself. If the data in SQL Server Management Studio is correct but the wrong data is being returned from the Entity Framework then you have this issue.
The cause of the issue is described here: https://github.com/dotnet/efcore/issues/7917
The proposed solution is to tack on a call to AsNoTracking(). Just be sure to thoroughly test your code after you do so. This solution worked for me and I was fortunate the C# method with the error was only called once from our application.
Hope you found that useful - subscribe for more C# and SQL tutorials.
Видео Entity Framework/EFCore Returns Wrong Data (When Using FromSqlRaw) канала Coding With Brett
Комментарии отсутствуют
Информация о видео
11 апреля 2022 г. 16:17:24
00:01:44
Другие видео канала





















