You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
When I check the nullity on a list in a select clause, I have a problem generating the sql query where there is ' . as col_3_0' [SQL: select organizati2_.Id as col_0_0_, organizati2_.Name as col_1_0_, user0_.Id as col_2_0_, . as col_3_0_, organizati4_.Id as id1_0_, organizati4_.Name as name2_0_ from Users user0_ left outer join OrganizationToUser organizati1_ on user0_.Id=organizati1_.UserId left outer join Organizations organizati2_ on organizati1_.OrganizationId=organizati2_.Id inner join OrganizationToUser organizati3_ on user0_.Id=organizati3_.UserId inner join Organizations organizati4_ on organizati3_.OrganizationId=organizati4_.Id] ---> System.Data.SqlClient.SqlException (0x80131904): Syntaxe incorrecte vers le mot clé 'as'.
when I remove the null check, there is no more problem.
Also, there is no problem if I remove my abstract class and implement the property in the base class.
I think there's a problem on your side, or have I missed a fundamental principle?
public abstract class AbstractUser
{
public AbstractUser()
{
OrganizationList = new HashSet<Organization>();
}
public virtual ISet<Organization> OrganizationList { get; set; }
}
public class User : AbstractUser
{
public virtual Guid Id { get; set; }
}
public class UserMap : ClassMap<User>
{
public UserMap()
{
Table("Users");
Id(x => x.Id);
HasManyToMany(x => x.OrganizationList)
.Table("OrganizationToUser") // Nom de la table de liaison
.ParentKeyColumn("UserId") // Clé étrangère de User dans la table de liaison
.ChildKeyColumn("OrganizationId") // Clé étrangère de Organization dans la table de liaison
.Inverse()
.Cascade.All();
}
}
The text was updated successfully, but these errors were encountered:
Hi,
When I check the nullity on a list in a select clause, I have a problem generating the sql query where there is ' . as col_3_0'
[SQL: select organizati2_.Id as col_0_0_, organizati2_.Name as col_1_0_, user0_.Id as col_2_0_, . as col_3_0_, organizati4_.Id as id1_0_, organizati4_.Name as name2_0_ from Users user0_ left outer join OrganizationToUser organizati1_ on user0_.Id=organizati1_.UserId left outer join Organizations organizati2_ on organizati1_.OrganizationId=organizati2_.Id inner join OrganizationToUser organizati3_ on user0_.Id=organizati3_.UserId inner join Organizations organizati4_ on organizati3_.OrganizationId=organizati4_.Id] ---> System.Data.SqlClient.SqlException (0x80131904): Syntaxe incorrecte vers le mot clé 'as'.
when I remove the null check, there is no more problem.
Also, there is no problem if I remove my abstract class and implement the property in the base class.
I think there's a problem on your side, or have I missed a fundamental principle?
Query:
session.Query<User>().Select(x => new { fullName = (x.OrganizationList != null ? x.OrganizationList.Select(y => y.Name) : null )).ToList()
Classes:
The text was updated successfully, but these errors were encountered: