Уникальное ограничение в коде Entity Framework First

Это работает для меня:

using System;
using System.Web;
using System.Web.Mvc;

public static class UrlExtensions
{
    public static string Content(this UrlHelper urlHelper, string contentPath, bool toAbsolute = false)
    {
        var path = urlHelper.Content(contentPath);
        var url = new Uri(HttpContext.Current.Request.Url, path);

        return toAbsolute ? url.AbsoluteUri : path;
    }
}

Использование в cshtml:

@Url.Content("~/Scripts/flot/jquery.flot.menuBar.js", true)
125
задан Will 1 March 2017 в 21:23
поделиться