پیاده سازی صحیح الگوی PRG در ASP.NET MVC
200, OK
https://www.exceptionnotfound.net/the-post-redirect-get-pattern-in-asp-net-mvc/ icon

خلاصه کار استفاده از دو اکشن فیلتر زیر برروی اکشن‌های GET و POST میباشد:

public abstract class ModelStateTransfer : ActionFilterAttribute  
{
    protected static readonly string Key = typeof(ModelStateTransfer).FullName;
}

public class ExportModelStateAttribute : ModelStateTransfer  
{
    public override void OnActionExecuted(ActionExecutedContext filterContext)
    {
        //Only export when ModelState is not valid
        if (!filterContext.Controller.ViewData.ModelState.IsValid)
        {
            //Export if we are redirecting
            if ((filterContext.Result is RedirectResult) || (filterContext.Result is RedirectToRouteResult))
            {
                filterContext.Controller.TempData[Key] = filterContext.Controller.ViewData.ModelState;
            }
        }

        base.OnActionExecuted(filterContext);
    }
}

public class ImportModelStateAttribute : ModelStateTransfer  
{
    public override void OnActionExecuted(ActionExecutedContext filterContext)
    {
        ModelStateDictionary modelState = filterContext.Controller.TempData[Key] as ModelStateDictionary;

        if (modelState != null)
        {
            //Only Import if we are viewing
            if (filterContext.Result is ViewResult)
            {
                filterContext.Controller.ViewData.ModelState.Merge(modelState);
            }
            else
            {
                //Otherwise remove it.
                filterContext.Controller.TempData.Remove(Key);
            }
        }

        base.OnActionExecuted(filterContext);
    }
}
پیاده سازی صحیح الگوی PRG در ASP.NET MVC
مثال هایی از نحوه نوشتن PBI
301, MovedPermanently
https://www.mountaingoatsoftware.com/agile/scrum/product-backlog/example icon
News  
  • As a site visitor, I can read current news on the home page.
  • As a site visitor, I can access old news that is no longer on the home page.
  • As a site visitor, I can email news items to the editor. (Note: this could just be an email link to
  • the editor.)
  • As a site a site editor, I can set the following dates on a news item: Start Publishing Date, Old
  • News Date, Stop Publishing Date. These dates refer to the date an item becomes visible on the site (perhaps next Monday), the date it stops appearing on the home page, and the date it is removed from the site (which may be never).
  • As a site member, I can subscribe to an RSS feed of news (and events? Or are they separate?).
  • As a site editor, I can assign priority numbers to news items. Items are displayed on the front page based on priority.  
مثال هایی از نحوه نوشتن PBI
تبدیل لیست های معمولی به ساختارهای درختی
301, MovedPermanently
http://www.codeproject.com/Articles/23949/Building-Trees-from-Lists-in-NET icon

تا به امروز به شخصه راه حلی برای برطرف کردن مشکل مربوط به استفاده از ویومدل‌ها برای عملیات Projection در هنگام استفاده از مدل‌های خود ارجاع دهنده در EF پیدا نکردم لذا تبدیل لیست‌های ساده به ساختار درختی بدون استفاده از امکان توکار EF ، شاید انتخاب بعدی باشد.

تبدیل لیست های معمولی به ساختارهای درختی
سری 6 قسمتی در رابطه با User Stories
401, Unauthorized
http://www.boostagile.com/user-stories-part-1-what-are-user-stories/ icon

A user story is a short description of something your customer will do when they come to your website or use your application. It focuses on the result or value that the customer gets. They are written from the customer’s point of view and in the language that they would use. 

سری 6 قسمتی در رابطه با User Stories