浏览代码

Added required columns to the child relationship

Kenric Nugteren 1 年之前
父节点
当前提交
f81556e419
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      InABox.Core/ILookupDefinition.cs

+ 5 - 0
InABox.Core/ILookupDefinition.cs

@@ -240,6 +240,11 @@ namespace InABox.Core
         {
             var columns = Columns.Create(TLookup);
 
+            foreach(var prop in DatabaseSchema.Properties(TLookup).Where(x => x.Required))
+            {
+                columns.Add(prop.Name);
+            }
+
             // Add any columns defined on a LookupDefinitionAttribute
             var generator = GetChildGenerator(TEntity, TLookup);
             if(generator != null)