我使用ObjectListView。并使用方法 RefreshObject() 更新唯一修改的对象。
// The difference between associations and updatedAssociations is only in
// one item, which ID field remains the same.
// So i find an updated item by ID in the associations (before updating).
//And say Object ListView to to refresh this item.
var associationToUpdate = associations.References.Where(
x => x.ID == associationIDToUpdate).FirstOrDefault();
olvAssociations.RefreshObject(associationToUpdate);
// And only after this set the model to updated model
associations = updatedAssociations;
Run Code Online (Sandbox Code Playgroud)
但什么也没有发生。有人知道这是怎么回事吗?
我尝试使用一组齐次参数为资源创建路由.
网址如下所示:products/category/{categoryId1}/{categoryId2} /.../ brand/{brandID1}/{brandID2}/...
并希望一个动作方法看起来像这样:public ActionResult GetProducts(IList categoryID,ILIsts brandID){...}
类别和品牌是独立过滤器.
我找到了类似任务的解决方案: ASP.NET MVC 2参数数组
并且想知道是否没有更美观的解决方案允许使用这个原型公共ActionResult GetProducts(IList categoryID)
而不是公共ActionResult myAction(字符串url)
行动方法
- 避免分裂弦和铸造?
我怎么能为我的案子适合这个解决方案?
先谢谢大家!