public static bool IsDebug(this HtmlHelper htmlHelper) { #if DEBUG return true; #else return false; #endif }
Then on our view, we could call the method:
@if (Html.IsDebug()) { @Html.Raw("<span style='color: red'>DEBUGGING MODE IS ON</span>"); }
Welcome to my blog site... hope my notes can help your coding becomes more cheerful :)
public static bool IsDebug(this HtmlHelper htmlHelper) { #if DEBUG return true; #else return false; #endif }
@if (Html.IsDebug()) { @Html.Raw("<span style='color: red'>DEBUGGING MODE IS ON</span>"); }
using (var scope = new TransactionScope()) { // some codes here . . . scope.Complete(); }
var transactionOptions = new TransactionOptions(); transactionOptions.IsolationLevel = IsolationLevel.ReadCommitted; transactionOptions.Timeout = TransactionManager.MaximumTimeout; var transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOptions);
<system.transactions> <machineSettings maxTimeout="00:30:00" /> </system.transactions>