Active Record Collection with Subsonic [closed]
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this questionI wish to make all my save transactions at the same time.
I'm using Subsonic 3.0 with active record. I've seen some post with MyClassCollection.Save();
However when i "Run Custom tool" i don't get collections. Obviously i'm missing a trick here?
There is of course another way to do this, using BatchQuery. I had an issue with this. Appreciate any thoughts, as you can see i've very new too all this.
var provider = ProviderFactory.GetProvider("MyProvider");
var batch = new BatchQuery(provider);
foreach (var cdnEntry in cdnEntries)
{
var query1 = new Insert(provider).Into<Clip>
开发者_如何学JAVA ("Author").Values(
cdnEntry.Author);
batch.QueueForTransaction(query1);
}
batch.ExecuteTransaction(); // nothing happens as query count alway = 0
I obviously need to read on the different patterns available for subsonic. Tho i have got the batchquery working. The above code works. I had few silly sql typo's giving me grief.
精彩评论