asp.net - POST request hangs at "pending" -
i have room
, room contains 0 or more devices
. have controller, roomcontroller
. here's simplified version of controller:
[responsetype(typeof(room))] public ihttpactionresult postroom(newroom newroom) { ... room room = new room(); room.building_id = newroom.building_id; ...and soforth... if(newroom.devices != null) { foreach (devicenew newdevice in newroom.devices) { device device = db.devices.firstordefault(d => d.id == newdevice.id); room.devices.add(device); } } db.savechanges(); return ok(room); }
the controller works. room
created, attached devices
. sadly, post
request never returns if there devices included in request. is, in chrome dev tools, request remains "pending" forever.
if there aren't devices, request returns 200
, expected.
again, controller works, devices
included. records created. route doesn't return ok
way should.
am missing something?
thanks!
edit:
the room
model (simplified):
namespace thething.models_database { using system; ... public partial class room { public room() { devices = new hashset<device>(); } public int id { get; set; } public virtual icollection<device> devices { get; set; } } }
and device
model (simplified):
namespace thething.models_database { using system; ... public partial class device { public device() { ... rooms = new hashset<room>(); } public int id { get; set; } ... public virtual icollection<room> rooms { get; set; } } }
Comments
Post a Comment