From 5380a9df005d722589d789559c04b89dd1fd64f9 Mon Sep 17 00:00:00 2001 From: 28810 <28810@YEXIANGQIN> Date: Mon, 1 Apr 2019 20:07:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E7=9A=84=E5=85=B3=E7=B3=BB=EF=BC=8C=E8=AF=AF?= =?UTF-8?q?=E5=B0=86=20ManyToOne=20=E8=AE=BE=E7=BD=AE=E6=88=90=E4=BA=86=20?= =?UTF-8?q?OneToMany?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FreeSql/Internal/Model/TableInfo.cs | 6 +++--- FreeSql/Internal/UtilsExpressionTree.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/FreeSql/Internal/Model/TableInfo.cs b/FreeSql/Internal/Model/TableInfo.cs index 87768191..e204ee07 100644 --- a/FreeSql/Internal/Model/TableInfo.cs +++ b/FreeSql/Internal/Model/TableInfo.cs @@ -24,7 +24,7 @@ namespace FreeSql.Internal.Model { internal void AddOrUpdateTableRef(string propertyName, TableRef tbref) { _refs.AddOrUpdate(propertyName, tbref, (ok, ov) => tbref); } - internal TableRef GetTableRef(string propertyName, bool isThrowException) { + public TableRef GetTableRef(string propertyName, bool isThrowException) { if (_refs.TryGetValue(propertyName, out var tryref) == false) return null; if (tryref.Exception != null) { if (isThrowException) throw tryref.Exception; @@ -34,7 +34,7 @@ namespace FreeSql.Internal.Model { } } - internal class TableRef { + public class TableRef { public PropertyInfo Property { get; set; } public TableRefType RefType { get; set; } @@ -51,7 +51,7 @@ namespace FreeSql.Internal.Model { public Exception Exception { get; set; } } - internal enum TableRefType { + public enum TableRefType { OneToOne, ManyToOne, OneToMany, ManyToMany } } \ No newline at end of file diff --git a/FreeSql/Internal/UtilsExpressionTree.cs b/FreeSql/Internal/UtilsExpressionTree.cs index 1eb539f9..26ea8e08 100644 --- a/FreeSql/Internal/UtilsExpressionTree.cs +++ b/FreeSql/Internal/UtilsExpressionTree.cs @@ -545,7 +545,7 @@ namespace FreeSql.Internal { } if (nvref.Columns.Count > 0 && nvref.RefColumns.Count > 0) { nvref.RefEntityType = tbref.Type; - nvref.RefType = isOnoToOne ? TableRefType.OneToOne : TableRefType.OneToMany; + nvref.RefType = isOnoToOne ? TableRefType.OneToOne : TableRefType.ManyToOne; trytb.AddOrUpdateTableRef(pnv.Name, nvref); }