Working on MVC 4 and Entity framework, facing a tricky problem after svind new record i've passed Id to view model but it's remaining same ;(:
public ActionResult Edit(SubscriptionViewModel oSubModel) {
    if (ModelState.IsValid) {
        Subscription oSubDetail = new Subscription();
        oSubDetail.Title = oSubModel.Title;
        oSubDetail = this.subRep.SaveSubscription(oSubDetail);
        if (oSubDetail == null) {
            ModelState.AddModelError("error", "Error in saving the data,please try after some time.");
        } else {
            oSubModel.Id = oSubDetail.Id; //Id return to view
            ModelState.AddModelError("success", "User saved");
        }
    }
    }
    return View(oSubModel); //Model return to view 
    // Note: id that I've passed display here correct but in view its still 0
}
@using (Html.BeginForm()) {
    <div class="row">
        @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 
        @Html.HiddenFor(model => model.Id)
        <div class="col-md-6">
            <div class="form-group">
                @Html.LabelFor(model => model.Title, htmlAttributes: new { @class = "control-label " })
                @Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Title, "", new { @class = "text-danger" })
            </div>
        </div>
        <div class="col-md-12">
            <div class="form-group">
                <input type="submit" value="Save" class="btn btn-primary" />
                <a href="@Url.Action(" Subscription ", "Subscription ")" class="btn btn-default">
                        Back to Subscriptions
                </a>
            </div>
        </div>
    </div>
}
Note: In Controller id that I've passed display correct but in view its still 0