|
@@ -140,6 +140,11 @@ namespace InABox.Core
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public static IEnumerable<Type> GetFormInstanceTypes()
|
|
|
+ {
|
|
|
+ return FormInstanceTypes.Select(x => x.Value.Item1);
|
|
|
+ }
|
|
|
+
|
|
|
public static Type? GetFormInstanceType(string appliesTo)
|
|
|
{
|
|
|
if (FormInstanceTypes.TryGetValue(appliesTo, out var result))
|
|
@@ -229,11 +234,16 @@ namespace InABox.Core
|
|
|
).FirstOrDefault();
|
|
|
}
|
|
|
|
|
|
- public static Type FormEntityType(Type TForm)
|
|
|
+ public static Type FormEntityLinkType(Type TForm)
|
|
|
{
|
|
|
var formInstanceType = TForm.GetInterfaceDefinition(typeof(IDigitalFormInstance<>))
|
|
|
?? throw new Exception("Form does not implement IDigitalFormInstance<>");
|
|
|
- var linkType = formInstanceType.GenericTypeArguments[0];
|
|
|
+ return formInstanceType.GenericTypeArguments[0];
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Type FormEntityType(Type TForm)
|
|
|
+ {
|
|
|
+ var linkType = FormEntityLinkType(TForm);
|
|
|
var linkInterface = linkType.GetInterfaceDefinition(typeof(IEntityLink<>));
|
|
|
return linkInterface!.GenericTypeArguments[0];
|
|
|
}
|