0
[HttpPost]
public ActionResult Save(IEnumerable<long> data,long playlistid=0)
{
    var q = from client in my.Clients(0, 0)
            join m in db.Playlists on client.ClientId equals m.ClientId
            join meta in db.ContentMetaDatas on m.PlaylistId equals meta.PlaylistId
            select new{
                    m.PlaylistId,
                    meta.ContentId,
                    m.PlaylistShortDescription,
                    meta.ContentMetaDataImage,
                    m.PlaylistTitle
                };


    return Json(data);
}

This is my Controller code in mvc for Updating values through AJAX Post. How can the database be updated?

MarcinJuraszek
  • 118,129
  • 14
  • 170
  • 241
Rahul RJ
  • 227
  • 3
  • 7
  • 15
  • http://stackoverflow.com/questions/5940225/fastest-way-of-inserting-in-entity-framework should help too. – yonexbat Apr 27 '13 at 14:18

1 Answers1

0

LINQ only supports querying (SELECT) from a datasource - inserting, updating, deleting, cannot be done with LINQ directly. You can just loop trough all the clients, and update them - not as sexy as LINQ but should be easy and painless :)

http://msdn.microsoft.com/en-us/library/bb399339.aspx << example

Dragos Bobolea
  • 752
  • 7
  • 16