ComaaSeperted Guid在mvc4中的sql中 [英] ComaaSeperted Guid In sql in mvc4
本文介绍了ComaaSeperted Guid在mvc4中的sql中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在mvc4中使用包含数据????的Union two commaseperated id我在我的控制器中使用代码..
How Union two commaseperated id which is contain data????in mvc4 i am using code in my controller..
public dynamic GetMenuItems()
{
//String role = Labs.Api.Auth.UserRole;
//string[] parts = role.Split(',');
DbContext.InitializeDbContext = new abc.Config.Models.Models.eCat_abccontextconfig();
var menuItems = Uow.Repository<vLeftTreeModule>().All().Where(obj => obj.RoleName == Labs.Api.Auth.UserRole
&& obj.Permission == 1).ToList();
return menuItems;
}
推荐答案
这不是问题。如果你想要一个逗号分隔列表,你最好的选择是从返回值构建一个,而不是试图在LINQ中使用。只需使用stringbuilder。
This is not a question. If you want a comma seperated list, your best bet is to build one from the return value, instead of trying to be fancy in LINQ. Just use a stringbuilder.
这篇关于ComaaSeperted Guid在mvc4中的sql中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文