- 修复 Ado.Net 扩展方法的多表查询 bug;#592

This commit is contained in:
2881099
2020-12-07 10:05:48 +08:00
parent 21d597be09
commit ade97b3f05
3 changed files with 82 additions and 27 deletions

View File

@ -0,0 +1,64 @@
using FreeSql.DataAnnotations;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics;
using System.Reflection;
using System.Text;
using System.Threading;
using Xunit;
namespace FreeSql.Tests.Issues
{
public class _592
{
[Fact]
public void AdoNet()
{
using (var conn = g.mysql.Ado.MasterPool.Get())
{
var list = conn.Value.Select<park_sys_users, park_sys_userrole>()
.LeftJoin((rs, le) => rs.user_id == le.ur_userid)
.Where((rs, le) => rs.user_id > 0)
.Count();
}
}
[Table(Name = "park_sys_users")]
public partial class park_sys_users
{
public park_sys_users()
{
}
[Column(IsIdentity = true)]
public int user_id { get; set; }
public string user_loginname { get; set; }
public string user_name { get; set; }
public string user_pwd { get; set; }
public int user_type { get; set; }
public string user_spotid { get; set; }
public string user_phone { get; set; }
public string user_email { get; set; }
public string user_remark { get; set; }
public int user_specialrole { get; set; }
public string user_createuser { get; set; }
public DateTime user_createtime { get; set; }
public int user_state { get; set; }
public int user_managetype { get; set; }
}
public partial class park_sys_userrole
{
public park_sys_userrole()
{
}
public int ur_id { get; set; }
public int ur_userid { get; set; }
public int ur_roleid { get; set; }
}
}
}