@@ -106,7 +106,7 @@ namespace InABox.Core
}
var setter = setters[i];
- if (setter != null && value != null)
+ if (setter != null && value != null && !(value is System.DBNull))
setter.Invoke(obj, value);
else
CoreUtils.SetPropertyValue(obj, column, value);
@@ -118,6 +118,7 @@ namespace InABox.Core
{
type = typeof(object);
+ CheckExpressions();
IsEntityLink = type.GetInterfaces().Contains(typeof(IEntityLink));
IsEnclosedEntity = type.GetInterfaces().Contains(typeof(IEnclosedEntity));
@@ -334,7 +334,7 @@ namespace InABox.Core
entity.UserProperties.Load(Properties(entity.GetType())
.Where(x => x is CustomProperty)
- .Select(x => new KeyValuePair<string, object?>(x.Name, x.PropertyType)));
+ .Select(x => new KeyValuePair<string, object?>(x.Name, DefaultValue(x.PropertyType))));
@@ -314,7 +314,7 @@ public class CodePopupEditorControl : DynamicEditorControl<Guid, CodePopupEditor
private string GetCodeColumn(Type type)
var prop = DatabaseSchema.Properties(type)
- .Where(x => x.Editor is BaseCodeEditor && !x.HasParentEntityLink())
+ .Where(x => x.Editor is UniqueCodeEditor && !x.HasParentEntityLink())
.FirstOrDefault() ?? throw new Exception($"No code property for {type.EntityName()}");
return prop.Name;