Syntax for “and” and distinct operation in entity framework?

I want to display the records whose accountid, id are matching and also display distinct records.

var result = from a in cxt.tblInventoryProducts
             where a.aid == accID && a.id == id
             select new
             {
                 a.productType,
                 a.productName
             };

Thanks in advance

Answers


Something like

var result = from a in cxt.tblInventoryProducts
             where a.aid == accID && a.id == id
             group a by new { a.productType, a.productName } into grp
             select new
             {
                 grp.Key.productType,
                 grp.Key.productName
             };

Need Your Help

Camera as background view?

iphone ios4 camera

I would like to test around a bit with augmented reality. My first problem is how to get the picture that comes from the camera as background for my view? For what i want to do, i dont need to acce...

How do I get this slideshow to pause on mouse hover?

javascript jquery html

I'm practically useless at JavaScript so I need your help to add a "pause on mouse hover" feature to this slideshow.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.