c# - How do I run a comparison using only one class twice? -


i have model:

public class parameter {     [key]     public int paramid { get; set; }     [display(name = "no.")]     public int paramno { get; set; }     [required]     [display(name = "title")]     public string parameter { get; set; }     [display(name = "meaning")]     public string description { get; set; }     [display(name = "synonym")]     public string synonym { get; set; }     public int catid { get; set; }     public virtual icollection<compareparameter> compareparameters { get; set; } } 

i need add model compares objects in parameter each of other objects in parameter. far have this:

public class compareparameter {     [key]     public int compareid { get; set; }     public int paramid1 { get; set; }     public int paramid2 { get; set; }     public virtual parameter parameters { get; set; }     public virtual parameter parameters2 { get; set; } } 

where paramid1 takes key parameter , paramid2 same. not appear working @ moment.

any ideas?

=== update question ===

with 2 models have given examples, should compareparameter allow me build controller , view have 2 dropdowns of same class. purpose of can link class possible outcomes.

you should derive parameter class comparer , implement comparison way.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -