powered by simpleCommunicator - 2.0.49     © 2025 Programmizd 02
Форумы / ADO.NET, LINQ, Entity Framework, NHibernate, DAL, ORM [игнор отключен] [закрыт для гостей] / Error The specified cast from a materialized 'System.DateTime' type to a nullable 'System
1 сообщений из 1, страница 1 из 1
Error The specified cast from a materialized 'System.DateTime' type to a nullable 'System
    #39031401
Pavluha
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Как понять, почему происходит ошибка вот здесь:
Код: c#
1.
2.
3.
if(context.Set<Table>()
                .Where(x => x.Year == model.Year && x.OrgId == _currentUser.OrgId)
                .Select(x => x.Approved).SingleOrDefault() != null)




Сама ошибка такая:
The specified cast from a materialized 'System.DateTime' type to a nullable 'System.DateTimeOffset' type is not valid


Entity
Код: c#
1.
2.
3.
4.
5.
6.
public class Table
    {
        public short Year { get; set; }
        public Guid OrgId { get; set; }
        public DateTimeOffset? Approved { get; set; }
    }
...
Рейтинг: 0 / 0
1 сообщений из 1, страница 1 из 1
Форумы / ADO.NET, LINQ, Entity Framework, NHibernate, DAL, ORM [игнор отключен] [закрыт для гостей] / Error The specified cast from a materialized 'System.DateTime' type to a nullable 'System
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]