Moved Model Name and Predictor Model Name to
Property Configuration
This commit is contained in:
@ -6,7 +6,7 @@ namespace View_by_Distance.PrepareForOld.Models.Binder;
|
||||
public class Configuration
|
||||
{
|
||||
|
||||
[Display(Name = "Property Configuration"), Required] public Property.Models.Configuration? PropertyConfiguration { get; set; }
|
||||
[Display(Name = "Property Configuration"), Required] public Property.Models.Configuration PropertyConfiguration { get; set; }
|
||||
[Display(Name = "Spelling"), Required] public string[] Spelling { get; set; }
|
||||
|
||||
public Configuration() => Spelling = Array.Empty<string>();
|
||||
|
@ -6,13 +6,13 @@ namespace View_by_Distance.PrepareForOld.Models;
|
||||
public class Configuration
|
||||
{
|
||||
|
||||
protected Property.Models.Configuration? _PropertyConfiguration;
|
||||
protected Property.Models.Configuration _PropertyConfiguration;
|
||||
protected readonly string[] _Spelling;
|
||||
public Property.Models.Configuration? PropertyConfiguration => _PropertyConfiguration;
|
||||
public Property.Models.Configuration PropertyConfiguration => _PropertyConfiguration;
|
||||
public string[] Spelling => _Spelling;
|
||||
|
||||
[JsonConstructor]
|
||||
public Configuration(Property.Models.Configuration? propertyConfiguration, string[] spelling)
|
||||
public Configuration(Property.Models.Configuration propertyConfiguration, string[] spelling)
|
||||
{
|
||||
_PropertyConfiguration = propertyConfiguration;
|
||||
_Spelling = spelling;
|
||||
@ -24,8 +24,10 @@ public class Configuration
|
||||
return result;
|
||||
}
|
||||
|
||||
public void Set(Property.Models.Configuration configuration) => _PropertyConfiguration = configuration;
|
||||
|
||||
public void Update() => _PropertyConfiguration?.Update();
|
||||
public void SetAndUpdate(Property.Models.Configuration configuration, int? numberOfJitters, int? numberOfTimesToUpsample, string? modelName, string? predictorModelName)
|
||||
{
|
||||
_PropertyConfiguration = configuration;
|
||||
_PropertyConfiguration.Update(numberOfJitters, numberOfTimesToUpsample, modelName, predictorModelName);
|
||||
}
|
||||
|
||||
}
|
@ -19,8 +19,7 @@ public abstract class Configuration
|
||||
if (result is null)
|
||||
throw new Exception(json);
|
||||
string jsonThis = result.ToString();
|
||||
result.Set(propertyConfiguration);
|
||||
result.Update();
|
||||
result.SetAndUpdate(propertyConfiguration, null, null, null, null);
|
||||
if (jsonThis != json)
|
||||
{
|
||||
int? check = null;
|
||||
|
Reference in New Issue
Block a user