title: How to perform SUM operation in Entity Framework
body: <p>I have a table.</p>
  
  <pre><code>create table tblCartItem(
  pkCartItemId int primary key identity,
  CartId int not null,
  ProductId int not null,
  Quantity int not null,
  Price nvarchar(15)
  )
  </code></pre>
  
  <p>and I want to perform sum opeartion on that like as </p>
  
  <pre><code>Select SUM(Price) from tblCartItem where CartId='107'
  </code></pre>
  
  <p>and I am trying to following code but its not working</p>
  
  <pre><code>ObjTempCart.CartTotal = (from c in db.tblCartItems where c.CartId == cartId select c.Price).Sum();
  </code></pre>
  
  <p>Any one help me to do this using Entity Framework.
  I am using MVC 4 Razor.</p>