<div class="container _full "> <div class="snippet-hidden" id="content"> <div itemtype="http://schema.org/Question" itemscope=""> <div class="inner-content clearfix"> <div id="mainbar" role="main" aria-label="question and answers"> <div class="question" id="question"
data-questionid="49238061"> <div class="post-layout"> <div class="postcell post-layout--right"> <div class="post-text" itemprop="text">
hi guys
I am trying to get the value of the primary key of my model
However I get 0
My code is
if (ModelState.IsValid) { context.Upload_Transaction.Add(upload_Transaction); await context.SaveChangesAsync(); id = Upload_Transaction.Upload_TransactionID; ViewData["id"] = id; // For some reason this returns 0 }</div> </div> </div> </div> </div> </div> </div> </div> </div>