New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the Community Exchange, where community members ask and answer questions about DNN. To get started, just start typing your question below and either select one of the suggested questions or ask a new question of your own.

How to retrieve ID of InfoObject added using DAL2/PETAPOCO?

Return to previous page

  • 3/15/2013
  • 7235 Views
  • 1 Answer
  • Last Activity: 6 years ago, moslem

Question:

rudgr long time ago

I'm adding my InfoObject using code below:

public static void AddArticle(ArticleInfo Article)
       {
           using (IDataContext context = DataContext.Instance())
           {
               var repository = context.GetRepository<ArticleInfo>();
               repository.Insert(Article);
           }
       }

 

How can I know the ID of the inserted item?

usually I would use SELECT SCOPE_IDENTITY?

but repository.Insert(Article); is of type  void?

 

thanks 

 

 

How to retrieve ID of InfoObject added using DAL2/PETAPOCO?

rudgr
rudgr long time ago
Add an Answer

Answers

Sign In to Participate
Or register to become a member