Ciao a tutti,
Sto cercando un modo per passare una lista di oggetto al mio metodo ma non riesco capire come.
codice:
[HttpGet]
public string SetEvent(int id, string description,DateTime date, int level, int type, int classEvent, int module, string descriptio)
{
try
{
using (Models.Model db = new Models.Model()) {
Models.GBL_EVENTS ev = new Models.GBL_EVENTS();
ev.ID = id;
ev.TS_INSERT = date;
ev.LEVEL = level;
ev.TYPE = type;
ev.EVENT_CLASS = classEvent;
ev.MODULE = module;
ev.DESCRIPTION = description;
db.GBL_EVENTS.Add(ev);
db.SaveChanges();
}
return "OK" + id + description;
}
catch
{
return "FAIL";
}
}
In sostanza ho realizzato un metodo che dati i sopracitati parametri mi crea un evento a db.
Come posso fare in modo che lato client vengano passati più eventi, senza effettuare n chiamate?
Grazie a tutti.