Automap viewmodels for details display
This commit is contained in:
@@ -35,40 +35,7 @@ namespace LeafWeb.WebCms.Models
|
||||
[Display(Name = "Range")]
|
||||
[RegularExpression(@"^([0-9]|[1-8][0-9]|9[0-9]|1[0-7][0-9]|180)$", ErrorMessage = "± longitude degrees")]
|
||||
public string lonr { get; set; }
|
||||
|
||||
static LeafDataQuery()
|
||||
{
|
||||
//Mapper.CreateMap<LeafInputCreate, LeafInput>()
|
||||
// .ForMember(dest => dest.PhotosynthesisType, opt => opt.Ignore());
|
||||
//Mapper.CreateMap<LeafInput, LeafInputCreate>()
|
||||
// .ForMember(dest => dest.PhotosynthesisType, opt => opt.Ignore());
|
||||
}
|
||||
|
||||
public LeafDataQuery()
|
||||
{
|
||||
//PhotosynthesisType = new SelectListViewModel();
|
||||
}
|
||||
|
||||
public NameValueCollection GetNameValueCollection(string prefix="")
|
||||
{
|
||||
var nvs = new NameValueCollection();
|
||||
|
||||
prefix =
|
||||
string.IsNullOrEmpty(prefix)
|
||||
? ""
|
||||
: prefix + ".";
|
||||
|
||||
foreach (var pi in typeof(LeafDataQuery).GetProperties())
|
||||
{
|
||||
var value = pi.GetValue(this, null);
|
||||
if (value == null)
|
||||
continue;
|
||||
nvs.Add(prefix + pi.Name, value?.ToString());
|
||||
}
|
||||
|
||||
return nvs;
|
||||
}
|
||||
|
||||
|
||||
public bool HasExtendedParameters =>
|
||||
!(
|
||||
string.IsNullOrEmpty(siteid)
|
||||
|
||||
Reference in New Issue
Block a user