<div mvc-lookup="Ids" url="People" add-handler="true"></div>
public class PeopleLookup : ALookup<Person>
{
private DbContext Context { get; }
public PeopleLookup(DbContext context)
{
Context = context;
FilterCase = LookupFilterCase.Lower;
}
public override IQueryable<Person> GetModels()
{
return Context.Set<Person>();
}
}
MvcLookup.lang = {
error: "Fehler beim Abrufen von Aufzeichnungen",
noData: "Keine Daten gefunden",
select: "Wählen ({0})",
search: "Suche...",
more: "Mehr..."
};
public class Person
{
[Key]
public Int32 Id { get; set; }
[LookupColumn]
[Display(Name = "Vorname")]
public String Name { get; set; }
[LookupColumn]
[Display(Name = "Nachname")]
public String Surname { get; set; }
[LookupColumn]
[Display(Name = "Einkommen")]
public Int32? Income { get; set; }
[Display(Name = "Geburtstag")]
[LookupColumn(Format = "{0:d}")]
public DateTime Birthday { get; set; }
}