asp.net - Inserting Sub-Array into Azure's Document DB -
i trying insert sub class (document) of "video" organization document.
however, when try add record, "object reference not set instance of object."
i tried use add , insert, neither worked. looked @ dcoument explorer , can see videos returning "null."
i assuming problem document db doesn't know video list. (in model, have defined list though)
also, have tried created new objects organization , video. also, have class called category, has exact same code (except object category) , inserting fine.
below action using.
[httppost] [validateantiforgerytoken] public async task<actionresult> create([bind(include = "name,description,link")] video video) { if (modelstate.isvalid) { usersession usersession = new usersession(); usersession = (usersession)session["user"]; organization organization = (organization)documentdbrepository<organization>.getitem(d => d.id == usersession.organizationid); video.dateadded = datetime.now; organization.videos.add(video); await documentdbrepository<organization>.updateitemasync(organization.id, organization); return redirecttoaction("index"); } return view(video); }
set organization.videos
non-null value. document db preserves stored. apparently, stored null
.
Comments
Post a Comment