开发者

Active Record Collection with Subsonic [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

This question does not appear to be about programming within the scope defined in the help center.

Closed 9 years ago.

Improve this question

I 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜