1
0

Intentando Clasificar (sin funcionar)

This commit is contained in:
2023-01-17 14:45:00 +01:00
parent 37e963a55f
commit 4ad973b516
7 changed files with 1050 additions and 36 deletions

View File

@@ -0,0 +1,53 @@
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
using System;
using System.Text;
using Microsoft.ML.Data;
namespace DictionaryToObjectConverterNamespace
{
public class <#= ClassName #> : testML.IDictionaryToObjectConverter
{
<# foreach (var key in Definition.Keys)
{
var type = Definition[key];
#>
[ColumnName("<#= key #>")]
public <#= type.FullName #> <#= key #> { get; set; }
<# } //Fin loop #>
public object this[string propertyName]
{
get { return GetValue(propertyName); }
set { SetValue(propertyName, value); }
}
public void SetValue(string propertyName, object value)
{
switch(propertyName)
{
<# foreach (var key in Definition.Keys) {
var type = Definition[key]; #>
case "<#= key #>": <#= key #> = (<#= type.FullName #>)value; break;
<# } #>
}
}
public object GetValue(string propertyName)
{
switch(propertyName)
{
<# foreach (var key in Definition.Keys) { #>
case "<#= key #>": return <#= key #>;
<# } #>
}
return null;
}
}
}