Development to meet some of the problems here, which is here to ask you
Today I finished the menu function,
Public classMenu { PublicObjectId _id {Get;Set; } Public intMenuId {Get;Set; } Public stringName {Get;Set; } Public intParentID {Get;Set; } Public stringURL {Get;Set; } Public stringIcon {Get;Set; } Public intOrderNo {Get;Set; } Public stringDESCR {Get;Set; } }
The first is a menu that is done in the most general manner using the internal key. When I finished it suddenly occurred to me that since the Monogo structure is so loose, why don't I put the menu as a word Gencun into it, then add a field
Public New List<menu> ();
stored in a database structure like this,
I thought everything was going well, but I realized that even the most basic function of inserting a submenu could not be achieved.
When I add a menu, I usually add a parent menu and then add a submenu to the parent menu, which is equivalent to modifying the child property of the document.
And then I'm going to write it in a modified way
parent. Child.add (menu); var queryid = Query.and (Query.eq ("MenuId", PID)); var update = Update.set ("child", menu); DAL. Dalmenu.update (Queryid, Update);
So here's the problem, Update.set () the second parameter of this function is bsonvalue type, I can't put a set as a parameter, the Update method must also specify a field to modify, and then I suddenly do not know how to modify.
Then I started Baidu (since Google highlighted China after I started Baidu), the results can be found are the basic additions and deletions to check, ah, quite helpless ah,
I hope I know how to do it.
C # Development MONGO note Seventh