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
Post a Comment