Skip to content

PostgreSQL Test Error when get Hours on TimeSpan #2950

Open
@sasukevita

Description

model

	[Table(Schema="Member", Name="Table")]
	public partial class Table
	{
		[PrimaryKey, NotNull    ] public int       Id   { get; set; } // integer
		[Column,        Nullable] public DateTime? Date { get; set; } // date
		[Column,        Nullable] public TimeSpan? Time { get; set; } // time without time zone
	}

error test

var query = (from x in db.Table
                         where x.Time.Value.Hours >= 0//Npgsql.PostgresException: '42883: operator does not exist: time without time zone > integer'
                         select new
                         {
                             Output = x.Time.Value.Hours,//LinqToDB.Common.LinqToDBConvertException: 'Cannot convert value '12:34:56' to type 'System.Int32''
                         });
            var r = query.ToArray();

Environment details

linq2db version: 3.3.0
Database: PostgreSQL 12.1
.NET Framework: 4.7.2

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions