Disappointing.
Samsung T3 512GB Performance on Dell E5570

I focus on C#, WCF/WF, WPF/Silverlight, DDD, UML/DSL/Modeling, OSLO/M, and Linq.
{
return View(GetData(principle, pageNumber));
}
where the result contains
result.Vegies where these are List<{ string Label, string Value }>
result.Proteins where these are List<{ string Name, string Value }>
at the Index.cshtml, you can do this.
<table style="width: 800px; width: auto "> <tr> <td style="width: 240px;">@Html.Partial("VegieView")<td><td style="width: 560px">@Html.Partial("ProteinView")<td><tr> <table>at the ../Shared/VegieView.cshtml you can do
@{ var oVegies = Model.Vegies as IEnumerable<Vegies>; } @foreach (var x in oVegies )
{ foreach (var y in x.Vegies) { <div>@Html.DisplayFor(j=> y.Label)<div>} }at the ../Shared/ProteinView.cshtml you can do
@{ var oProteins = Model.Proteins as IEnumerable<Proteins>; } @foreach (var x in oProteins)
{ foreach (var y in x.Proteins) { <div>@Html.DisplayFor(j=> y.Name)<div>} }So, a single controller call can update all shared view models..:-) neat!I know, you are welcome.
$.ajax({ type: "POST", url: "http://localhost:5000/Search/GetData", data: JSONData, }).done(function (msg) { alert("Data Saved: " + msg); });
public class SearchResult { public JsonResult data { get; set; } public int PageNumber { get; set; } public int PageSize { get; set; } public int PageCount { get; set; } public int DataCount { get; set; } }
public class SearchPackage { public SearchItem[] Items { get; set; } public int PageNumber { get; set; } public int PageSize { get; set; } }
public class SearchItem { public string FieldName { get; set; } public string Value { get; set; } public SortDirection SortDirection { get; set; } }
var JSONData = { "SearchItem": [{ "fieldName": "LastName", "value": "Smith", "sortDirection": "SortDirection.ASC" }, { "fieldName": "FirstName", "value": "John", "sortDirection": "SortDirection.DESC"}]};If you are passing an url value for the data, you can dourl: "http://localhost:5000/Search/GetData?fieldNames=LastName&fieldNames=FirstName&values=Smith&values=John&sortDirections=SortDirection.ASC&sortDirections=SortDirection.Desc";
[HttpPost] public JsonDataResult GetData(List<string> fieldNames, List<string> values, List<int> sortDirections) {using (var proxy = searchFactory.CreateChannel()) {SearchResult oSearchResult = SearchFactory.GetRequestPackage(Transform(fieldNames, values, sortDirections)); return Json(oSearchResult );} }Since there are two parameters called the fieldNames, such parameters is like passing a ListfieldName.
You can trigger an event of a HTMLElement calling the onclick event of the element.
Let's say, you have <div><ul><li><dl><dd parent="MotorCycle">Honda VFR1200Fdd>dl>li>ul>div>
Then you can do
<div onclick="triggerFilterEvent(this)">Honda VFR1200Fdiv>
The reason you do is so that you don't have duplicated method calls. The parameters allow you to traverse through its DOM tree.
function triggerFilterEvent(object1) {
var category = $(object1).attr("parent");
var root = $("div");var value = $(object1).text();
var dls = $(root).find("ul li dl"); var dds = $(dls).find("dd[parent='" + category + "']"); for (var x = 0; x < $(dds).length; x++) { var dd = $(dds)[x]; if (dd.innerText === value) { $(dd).click(); } } }
you could do var dd =$("div ul li dl dd[parent='"+category +"']").click(); but on IE version < 9, the code would encounter problems.You also note that I did the for loop instead of the jQuery.each().
[ServiceContract] public interface ITestService { [OperationContract] [WebGet(ResponseFormat = WebMessageFormat.Json, UriTemplate = "GetJsonData/{param}")] string GetJsonData(string text); }[ServiceBehavior(Name = "WCFHost.AjaxDataService", Namespace = "http://localhost:2469/",InstanceContextMode = InstanceContextMode.PerCall,
ConcurrencyMode = ConcurrencyMode.Multiple), AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class TestService : ITestService {public string GetJsonData(string param) { return GetData2(param);}}
JavaScript
function AjaxGrid(id) {
this.GetJsonData = function (object1, param) { var statusNode = $(".Status"); jQuery.ajax({ url: "WCFHost/AjaxDataService.svc/GetJsonData?param=" + param, type: "POST", dataType: "json", async: true, beforeSend: function () { statusNode.text("Do Something on Before"); }, success: function (xhr) { statusNode.text("Do Something on Success"); }, complete: function () { statusNode.text("Do Something on Complete"); }, error: function () { statusNode.text("Do Something on No Way!"); } }); }}
However, with asp.net MVC, you can make calls directly to specified controller.
in a AwesomeController.cs
public class SearchController : Controller {
[HttpPost] public JsonResult GetJsonData(string param) { return Json(GetData2(param)); }}JavaScript
function AjaxGrid(id) {
this.GetJsonData = function (object1, param) { var statusNode = $(".Status"); jQuery.ajax({ url: "AwesomeController/GetJsonData?param=" + param, type: "POST", dataType: "json", async: true, beforeSend: function () { statusNode.text("Do Something on Before"); }, success: function (xhr) { statusNode.text("Do Something on Success"); }, complete: function () { statusNode.text("Do Something on Complete"); }, error: function () { statusNode.text("Do Something on No Way!"); } }); }}