Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 15, 2012 05:05 AM by thaicarrot
Participant
1118 Points
1001 Posts
Feb 13, 2012 07:06 AM|LINK
Hi,
I'm currently using datasets for my cached data, however I'm looking at Ling to Sql.
In my existsing object library I would do something like this to create a collection:
public class MyCollection : Collection<MyClass>
{
}
How is this replicated in the designer?
Thanks
John
Contributor
5132 Points
1465 Posts
Feb 13, 2012 03:43 PM|LINK
I am not understand much about your Q http://msdn.microsoft.com/en-us/library/ms668604.aspx
All-Star
118619 Points
18779 Posts
Feb 15, 2012 12:17 AM|LINK
I cannot understand what you mean by using the above codes?This is not Linq to SQL but Linq to Object。And Collection has referred a List<T>,So you can use that directly。
Reguards!
Feb 15, 2012 05:05 AM|LINK
class ObservableT : ObservableCollection<T>
public ObservableDriver(DataContext DataDC)
foreach (T in DataDC.T)
this.Add(ex);
//How to use
DataContext = new DataContext();
ObservableT table = new ObservableT(TEntity);
You can expose it as Static
sephiroth100
Participant
1118 Points
1001 Posts
Linq to SQL
Feb 13, 2012 07:06 AM|LINK
Hi,
I'm currently using datasets for my cached data, however I'm looking at Ling to Sql.
In my existsing object library I would do something like this to create a collection:
public class MyCollection : Collection<MyClass>
{
}
How is this replicated in the designer?
Thanks
John
thaicarrot
Contributor
5132 Points
1465 Posts
Re: Linq to SQL
Feb 13, 2012 03:43 PM|LINK
Hi,
I am not understand much about your Q http://msdn.microsoft.com/en-us/library/ms668604.aspx
Weera
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Linq to SQL
Feb 15, 2012 12:17 AM|LINK
I cannot understand what you mean by using the above codes?This is not Linq to SQL but Linq to Object。And Collection has referred a List<T>,So you can use that directly。
Reguards!
thaicarrot
Contributor
5132 Points
1465 Posts
Re: Linq to SQL
Feb 15, 2012 05:05 AM|LINK
Hi,
class ObservableT : ObservableCollection<T>
{
public ObservableDriver(DataContext DataDC)
{
foreach (T in DataDC.T)
{
this.Add(ex);
}
}
}
//How to use
DataContext = new DataContext();
ObservableT table = new ObservableT(TEntity);
You can expose it as Static
Weera