global nuget directory

create nuget.config file <?xml version=”1.0″ encoding=”utf-8″?> <configuration> <config> <add key=”repositoryPath” value=”C:\Nuget Packages” /> </config> </configuration> copy this file to Solution Directory open notepad++ and find and replace text below find – ..\packages replace with – C:\Nuget Packages filters – *.csproj click find and replace button it will replace references . create folder C:\Nuget Packages Done! Build solution all nuget… Read More global nuget directory

Get version from request header

private string GetVersionFromAcceptHeaderVersion(HttpRequestMessage request) { string temp = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, “Controllers”); if (System.Web.HttpContext.Current.Request.Headers[“X-Api-Version”] != null) { IEnumerable<string> headerValues = request.Headers.GetValues(“X-Api-Version”); if (headerValues != null) { return headerValues.FirstOrDefault(); } return string.Empty; } else { var latestversion = Directory.GetDirectories(temp) .OrderByDescending(dir => dir) .FirstOrDefault(); return latestversion.Substring(latestversion.Length – 1); } }

Dirty read set flag for update record angular js

$scope.Update = function () { var index = 0; var arrPermissions = []; $scope.dataResult.forEach(function (row) { if (row.IsDirty == true) { arrPermissions.push(row); } }); SpinStart(); $http.post(“Security/Update”, { ViewModels: arrPermissions }) .success(function (data) { alert(” updated successfully.”); }) .error(function () { SpinStop(); alert(“Not valid.”); }); } // key press event $scope.Changed = function (id) { var… Read More Dirty read set flag for update record angular js

chosen js dropdown last select issue

Error on last item selection When I select last item on second time. It is giving an error “Uncaught TypeError: Cannot set property ‘selected’ of undefined” on every chosen. solution I had the same problem with this behavior. I used the following as workaround: <select chosen data-placeholder=”Placeholder” ng-model=”myValue” ng-options=”item.name for item in itemList” > <option… Read More chosen js dropdown last select issue

Custom Media formatter – HttpClient

send file from one solution to other solution Client public void UploadDomainAssembly(string filename) { String strFile = System.IO.Path.GetFileName(filename); using (var client = new HttpClient()) using (var content = new MultipartFormDataContent()) { // Make sure to change API address client.BaseAddress = new Uri(“http://localhost:8090/&#8221;); var fileContent = new ByteArrayContent(File.ReadAllBytes(filename)); fileContent.Headers.ContentDisposition = new ContentDispositionHeaderValue(“AssemblyAttachment”) { FileName = strFile };… Read More Custom Media formatter – HttpClient