Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. LINQ to Entities exception [modified]

LINQ to Entities exception [modified]

Scheduled Pinned Locked Moved LINQ
csharpwcflinqsalesquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pioner
    wrote on last edited by
    #1

    I have SL+WCF+EntityFramework project. Silverlight code: private void theDataGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { object selected = theDataGrid.SelectedItem; proxy.GetOrdersByCustomerAsync(selected as NorthwindService.Customers); proxy.GetOrdersByCustomerCompleted += new EventHandler (proxy_GetOrdersByCustomerCompleted); } void proxy_GetOrdersByCustomerCompleted(object sender, Europlan2.NorthwindService.GetOrdersByCustomerCompletedEventArgs e) { theDataGrid2.ItemsSource = e.Result; } WCF Code: [OperationContract] public List < CustomersOrder > GetOrdersByCustomer(Customers customer) { NORTHWNDEntities proxy = new NORTHWNDEntities(); var orders = from ord in proxy.Orders where ord.Customers.CustomerID == customer.CustomerID select new CustomersOrder(ord.Customers.ContactName, ord.ShipCity); return orders.ToList(); } It doesn`t work.Exception says only parameterless constructors allowed in LINQ to Entities.(((( So how can i return not List < Orders > but List < Of just some fields of Orders class > Besides DataGrid needs strongly typed objects to autogenerate columns. Thanks

    modified on Saturday, June 20, 2009 2:37 AM

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups