FAQ Database Discussion Community


Enumerated list of child class not working

c#,asp.net-mvc,view,icollection
I am creating a webpage for a help desk software where the top shows the information from the ticket class and then the bottom for the ticketNotes that are attached to the ticket class through an ICollection. Currently if I comment out the bottom, the top portion (the static table)...

LINQ related error "Unable to create a constant value of type 'System.Object'. Only primitive types or enumeration types are supported in this context

asp.net-mvc,database,linq,icollection
I have some code that is selecting some values from my database. I have a IQueryable of requests, that contains a ICollection of rooms. I want to get a List<ICollection<rooms>>. I have tried the following and i recieve the above error. Any ideas?? public ActionResult _roomChecker(checkRooms JSONdata){ var rooms =...

Collection of key-value pairs where only key type is known

c#,generics,icollection,keyvaluepair
I want a collection class of key-value pairs, where ill know the key type at instantiation level but ill only know the value type when adding a new element to the collection. Consider a the code snippet below public class Collection<TKey> where TKey : class { public ICollection<KeyValuePair<TKey, IValue>> Col...

How to iterate over @Model.ICollection in Java Script function?

javascript,.net,asp.net-mvc,razor,icollection
I have a @Model.LoginCoordinates where LoginCoordinates is ICollection<Coordinates>. The Coordinates class: public class Coordinates { public int Id { get; set; } public double Latitude { get; set; } public double Longitude { get; set; } } Inside the view in I have: <script> function f(){ for (var i =...