Hi
I get error “Npgsql.PostgresException: ‘42P01: missing FROM-clause entry for table “account”’” when I want to exec select with join on this DTO:
public class Account : IHasId<long>
{
[PrimaryKey, AutoIncrement] public long Id { get; set; }
[StringLength(250), Required]
public string Desc { get; set; }
[StringLength(50)]
public string FIX_Id { get; set; }
[StringLength(250)]
public string FIX_Desc { get; set; }
[Required]
public int Active { get; set; }
[Required]
public long Currency { get; set; }
[Default(OrmLiteVariables.SystemUtc), Required]
public DateTime DInsert { get; set; }
[RowVersion, Alias("LastChanged")]
public ulong RowVersion { get; set; }
}
Here is the code how I have configured provider:
var dialect = PostgreSqlDialect.Provider;
dialect.GetDateTimeConverter().DateStyle = DateTimeKind.Utc;
dialect.GetStringConverter().UseUnicode = true;
dialect.NamingStrategy = new OrmLiteNamingStrategyBase();
var dbcf = new OrmLiteConnectionFactory(appConfig.SqlDbServerPrimaryTotalConnectionString, dialect);
Here is generated SQL:
SELECT "Account"."Id", "Account"."Desc", "Account"."FIX_Id", "Account"."FIX_Desc", "Account"."Active", "Account"."Currency", "Account"."DInsert", Account."xmin" AS "LastChanged"
FROM "Account" INNER JOIN "ClientAccount" ON (("Account"."Id" = "ClientAccount"."Account") AND ("ClientAccount"."Client" = 12345))
As you can see, in SQL statement there is no quoted table name for alias LastChanged, and that is reason for the error that I get, can you please help me what I need to do so that AliasAttribute will take quoted TableName?
Thank you for your answer.
best regards
Ervin