0

I’d like to know how to use LiveLinq with Linq-2-SQL and a pre-existing DBML (in a separate DLL). I already have a System.Data.Linq.DataContext

Can LiveLinq work here. I’m currently interested in using the extension .AsLive() but the other extensions are quite interesting as well. It seems that Linq-2-SQL is not supported. Only ADO.Net is. No one seems to answer the same question I asked at the forum so I'm seeking help/advise from someone using C1's LiveLinq.

Regards.

Jalal Said
  • 15,906
  • 7
  • 45
  • 68
DoomerDGR8
  • 4,840
  • 6
  • 43
  • 91

1 Answers1

0

Yes, LiveLinq can work with LINQ2SQL data. Basically, it can work with any “observable” or “bindable” data, with anything that you can bind controls to. There is an extension method .AsLive(IBindingList) (in C1.LivqLinq.LiveViewExtensions). So you can apply .AsLive(this IBindingList) to a query like this:

var query = (from p in db.Products where p.Category.CategoryName == “Beverages” select p); IBindingList ibl = ((IListSource) query).GetList(); C1.LiveLinq.LiveViews.View liveView = ibl.AsLive(ibl);

That will create a live view ((I did not check that the code works, there may be typos).

You can also apply .AsLive in a similar way to classes Table and EntitySet that also implement IListSource.

This response was taken from the one given here: http://our.componentone.com/groups/entity-framework/studio-for-entity-framework/forum/topic/using-with-linq-2-sql-and-a-pre-existing-dbml-in-a-separate-dll/

vanslyker
  • 306
  • 2
  • 8