Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all 7215 articles
Browse latest View live

Edited Issue: $select and $expand not working properly for complex types in json formatter [1048]

$
0
0
Given the following model:

```
public class JsonSelectCustomer
{
public int Id { get; set; }
public string Name { get; set; }
public virtual IList<JsonSelectOrder> JsonSelectOrders { get; set; }
}

public class JsonSelectPremiumCustomer : JsonSelectCustomer
{
public string Category { get; set; }
public IList<JsonSelectBonus> Bonuses { get; set; }
}

public class JsonSelectBonus
{
public int Id { get; set; }
public double Ammount { get; set; }
}

public class JsonSelectOrder
{
public int Id { get; set; }
public DateTime Date { get; set; }
public JsonSelectAddress BillingAddress { get; set; }
public virtual IList<JsonSelectOrderDetail> OrderDetails { get; set; }
}

public class JsonSelectAddress
{
public string FirstLine { get; set; }
public string SecondLine { get; set; }
public int ZipCode { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Country { get; set; }
}

public class JsonSelectOrderDetail
{
public int Id { get; set; }
public string Name { get; set; }
public int Ammount { get; set; }
public double Price { get; set; }
}
```

When a customer issues the following query:
/api/JsonSelectCustomer?$select=Id,JsonSelectOrders&$expand=JsonSelectOrders

The JsonSelectAddress property doesn't get serialized as it does in the OData case.
Here is the response payload sample:

```
[
{
"Id": 0,
"JsonSelectOrders": []
},
{
"Id": 1,
"JsonSelectOrders": [
{
"Id": 0,
"Date": "2013-05-14T11:20:45.2454402-07:00"
}
]
},
{
"Id": 2,
"JsonSelectOrders": [
{
"Id": 0,
"Date": "2013-05-14T11:20:45.2464399-07:00"
},
{
"Id": 1,
"Date": "2013-05-13T11:20:45.2464399-07:00"
}
]
},
{
"Id": 3,
"JsonSelectOrders": [
{
"Id": 0,
"Date": "2013-05-14T11:20:45.2474403-07:00"
},
{
"Id": 1,
"Date": "2013-05-13T11:20:45.2474403-07:00"
},
{
"Id": 2,
"Date": "2013-05-12T11:20:45.2474403-07:00"
}
]
},
{
"Id": 4,
"JsonSelectOrders": [
{
"Id": 0,
"Date": "2013-05-14T11:20:45.2474403-07:00"
},
{
"Id": 1,
"Date": "2013-05-13T11:20:45.2474403-07:00"
},
{
"Id": 2,
"Date": "2013-05-12T11:20:45.2474403-07:00"
},
{
"Id": 3,
"Date": "2013-05-11T11:20:45.2474403-07:00"
}
]
},
{
"Id": 5,
"JsonSelectOrders": [
{
"Id": 0,
"Date": "2013-05-14T11:20:45.2474403-07:00"
},
{
"Id": 1,
"Date": "2013-05-13T11:20:45.2474403-07:00"
},
{
"Id": 2,
"Date": "2013-05-12T11:20:45.2474403-07:00"
},
{
"Id": 3,
"Date": "2013-05-11T11:20:45.2474403-07:00"
},
{
"Id": 4,
"Date": "2013-05-10T11:20:45.2474403-07:00"
}
]
},
{
"Id": 6,
"JsonSelectOrders": [
{
"Id": 0,
"Date": "2013-05-14T11:20:45.2474403-07:00"
},
{
"Id": 1,
"Date": "2013-05-13T11:20:45.2474403-07:00"
},
{
"Id": 2,
"Date": "2013-05-12T11:20:45.2474403-07:00"
},
{
"Id": 3,
"Date": "2013-05-11T11:20:45.2474403-07:00"
},
{
"Id": 4,
"Date": "2013-05-10T11:20:45.2474403-07:00"
},
{
"Id": 5,
"Date": "2013-05-09T11:20:45.2474403-07:00"
}
]
},
{
"Id": 7,
"JsonSelectOrders": [
{
"Id": 0,
"Date": "2013-05-14T11:20:45.2474403-07:00"
},
{
"Id": 1,
"Date": "2013-05-13T11:20:45.2474403-07:00"
},
{
"Id": 2,
"Date": "2013-05-12T11:20:45.2474403-07:00"
},
{
"Id": 3,
"Date": "2013-05-11T11:20:45.2474403-07:00"
},
{
"Id": 4,
"Date": "2013-05-10T11:20:45.2474403-07:00"
},
{
"Id": 5,
"Date": "2013-05-09T11:20:45.2474403-07:00"
},
{
"Id": 6,
"Date": "2013-05-08T11:20:45.2474403-07:00"
}
]
},
{
"Id": 8,
"JsonSelectOrders": [
{
"Id": 0,
"Date": "2013-05-14T11:20:45.2474403-07:00"
},
{
"Id": 1,
"Date": "2013-05-13T11:20:45.2474403-07:00"
},
{
"Id": 2,
"Date": "2013-05-12T11:20:45.2474403-07:00"
},
{
"Id": 3,
"Date": "2013-05-11T11:20:45.2474403-07:00"
},
{
"Id": 4,
"Date": "2013-05-10T11:20:45.2474403-07:00"
},
{
"Id": 5,
"Date": "2013-05-09T11:20:45.2474403-07:00"
},
{
"Id": 6,
"Date": "2013-05-08T11:20:45.2474403-07:00"
},
{
"Id": 7,
"Date": "2013-05-07T11:20:45.2474403-07:00"
}
]
},
{
"Id": 9,
"JsonSelectOrders": [
{
"Id": 0,
"Date": "2013-05-14T11:20:45.2474403-07:00"
},
{
"Id": 1,
"Date": "2013-05-13T11:20:45.2474403-07:00"
},
{
"Id": 2,
"Date": "2013-05-12T11:20:45.2474403-07:00"
},
{
"Id": 3,
"Date": "2013-05-11T11:20:45.2474403-07:00"
},
{
"Id": 4,
"Date": "2013-05-10T11:20:45.2474403-07:00"
},
{
"Id": 5,
"Date": "2013-05-09T11:20:45.2474403-07:00"
},
{
"Id": 6,
"Date": "2013-05-08T11:20:45.2474403-07:00"
},
{
"Id": 7,
"Date": "2013-05-07T11:20:45.2474403-07:00"
},
{
"Id": 8,
"Date": "2013-05-06T11:20:45.2474403-07:00"
}
]
}
]
```



Commented Issue: $select and $expand not working properly for complex types in json formatter [1048]

$
0
0
Given the following model:

```
public class JsonSelectCustomer
{
public int Id { get; set; }
public string Name { get; set; }
public virtual IList<JsonSelectOrder> JsonSelectOrders { get; set; }
}

public class JsonSelectPremiumCustomer : JsonSelectCustomer
{
public string Category { get; set; }
public IList<JsonSelectBonus> Bonuses { get; set; }
}

public class JsonSelectBonus
{
public int Id { get; set; }
public double Ammount { get; set; }
}

public class JsonSelectOrder
{
public int Id { get; set; }
public DateTime Date { get; set; }
public JsonSelectAddress BillingAddress { get; set; }
public virtual IList<JsonSelectOrderDetail> OrderDetails { get; set; }
}

public class JsonSelectAddress
{
public string FirstLine { get; set; }
public string SecondLine { get; set; }
public int ZipCode { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Country { get; set; }
}

public class JsonSelectOrderDetail
{
public int Id { get; set; }
public string Name { get; set; }
public int Ammount { get; set; }
public double Price { get; set; }
}
```

When a customer issues the following query:
/api/JsonSelectCustomer?$select=Id,JsonSelectOrders&$expand=JsonSelectOrders

The JsonSelectAddress property doesn't get serialized as it does in the OData case.
Here is the response payload sample:

```
[
{
"Id": 0,
"JsonSelectOrders": []
},
{
"Id": 1,
"JsonSelectOrders": [
{
"Id": 0,
"Date": "2013-05-14T11:20:45.2454402-07:00"
}
]
},
{
"Id": 2,
"JsonSelectOrders": [
{
"Id": 0,
"Date": "2013-05-14T11:20:45.2464399-07:00"
},
{
"Id": 1,
"Date": "2013-05-13T11:20:45.2464399-07:00"
}
]
},
{
"Id": 3,
"JsonSelectOrders": [
{
"Id": 0,
"Date": "2013-05-14T11:20:45.2474403-07:00"
},
{
"Id": 1,
"Date": "2013-05-13T11:20:45.2474403-07:00"
},
{
"Id": 2,
"Date": "2013-05-12T11:20:45.2474403-07:00"
}
]
},
{
"Id": 4,
"JsonSelectOrders": [
{
"Id": 0,
"Date": "2013-05-14T11:20:45.2474403-07:00"
},
{
"Id": 1,
"Date": "2013-05-13T11:20:45.2474403-07:00"
},
{
"Id": 2,
"Date": "2013-05-12T11:20:45.2474403-07:00"
},
{
"Id": 3,
"Date": "2013-05-11T11:20:45.2474403-07:00"
}
]
},
{
"Id": 5,
"JsonSelectOrders": [
{
"Id": 0,
"Date": "2013-05-14T11:20:45.2474403-07:00"
},
{
"Id": 1,
"Date": "2013-05-13T11:20:45.2474403-07:00"
},
{
"Id": 2,
"Date": "2013-05-12T11:20:45.2474403-07:00"
},
{
"Id": 3,
"Date": "2013-05-11T11:20:45.2474403-07:00"
},
{
"Id": 4,
"Date": "2013-05-10T11:20:45.2474403-07:00"
}
]
},
{
"Id": 6,
"JsonSelectOrders": [
{
"Id": 0,
"Date": "2013-05-14T11:20:45.2474403-07:00"
},
{
"Id": 1,
"Date": "2013-05-13T11:20:45.2474403-07:00"
},
{
"Id": 2,
"Date": "2013-05-12T11:20:45.2474403-07:00"
},
{
"Id": 3,
"Date": "2013-05-11T11:20:45.2474403-07:00"
},
{
"Id": 4,
"Date": "2013-05-10T11:20:45.2474403-07:00"
},
{
"Id": 5,
"Date": "2013-05-09T11:20:45.2474403-07:00"
}
]
},
{
"Id": 7,
"JsonSelectOrders": [
{
"Id": 0,
"Date": "2013-05-14T11:20:45.2474403-07:00"
},
{
"Id": 1,
"Date": "2013-05-13T11:20:45.2474403-07:00"
},
{
"Id": 2,
"Date": "2013-05-12T11:20:45.2474403-07:00"
},
{
"Id": 3,
"Date": "2013-05-11T11:20:45.2474403-07:00"
},
{
"Id": 4,
"Date": "2013-05-10T11:20:45.2474403-07:00"
},
{
"Id": 5,
"Date": "2013-05-09T11:20:45.2474403-07:00"
},
{
"Id": 6,
"Date": "2013-05-08T11:20:45.2474403-07:00"
}
]
},
{
"Id": 8,
"JsonSelectOrders": [
{
"Id": 0,
"Date": "2013-05-14T11:20:45.2474403-07:00"
},
{
"Id": 1,
"Date": "2013-05-13T11:20:45.2474403-07:00"
},
{
"Id": 2,
"Date": "2013-05-12T11:20:45.2474403-07:00"
},
{
"Id": 3,
"Date": "2013-05-11T11:20:45.2474403-07:00"
},
{
"Id": 4,
"Date": "2013-05-10T11:20:45.2474403-07:00"
},
{
"Id": 5,
"Date": "2013-05-09T11:20:45.2474403-07:00"
},
{
"Id": 6,
"Date": "2013-05-08T11:20:45.2474403-07:00"
},
{
"Id": 7,
"Date": "2013-05-07T11:20:45.2474403-07:00"
}
]
},
{
"Id": 9,
"JsonSelectOrders": [
{
"Id": 0,
"Date": "2013-05-14T11:20:45.2474403-07:00"
},
{
"Id": 1,
"Date": "2013-05-13T11:20:45.2474403-07:00"
},
{
"Id": 2,
"Date": "2013-05-12T11:20:45.2474403-07:00"
},
{
"Id": 3,
"Date": "2013-05-11T11:20:45.2474403-07:00"
},
{
"Id": 4,
"Date": "2013-05-10T11:20:45.2474403-07:00"
},
{
"Id": 5,
"Date": "2013-05-09T11:20:45.2474403-07:00"
},
{
"Id": 6,
"Date": "2013-05-08T11:20:45.2474403-07:00"
},
{
"Id": 7,
"Date": "2013-05-07T11:20:45.2474403-07:00"
},
{
"Id": 8,
"Date": "2013-05-06T11:20:45.2474403-07:00"
}
]
}
]
```


Comments: Agree this is by design. Assigning to myself to give it another thought before resolving as By Design

Edited Issue: $select response on Json formatter not maintaning the order of properties mentioned in the $select query. [1049]

$
0
0
I checked with OData formatter and there the order is maintained as expected.

Request(note the order of properties):
http://localhost:63523/api/Categories?$top=3&$select=Description,CategoryName

Response:
[{"CategoryName":"Beverages","Description":"Soft drinks, coffees, teas, beers, and ales"},{"CategoryName":"Condiments","Description":"Sweet and savory sauces, relishes, spreads, and seasonings"},{"CategoryName":"Confections","Description":"Desserts, candies, and sweet breads"}]

I have the following model for Category(from Northwind):
```
namespace SampleWebApiApp.Models
{
using System;
using System.Collections.Generic;

public partial class Category
{
public Category()
{
this.Products = new HashSet<Product>();
}

public int CategoryID { get; set; }
public string CategoryName { get; set; }
public string Description { get; set; }
public byte[] Picture { get; set; }

public virtual ICollection<Product> Products { get; set; }
}
}
```

Commented Issue: $select response on Json formatter not maintaning the order of properties mentioned in the $select query. [1049]

$
0
0
I checked with OData formatter and there the order is maintained as expected.

Request(note the order of properties):
http://localhost:63523/api/Categories?$top=3&$select=Description,CategoryName

Response:
[{"CategoryName":"Beverages","Description":"Soft drinks, coffees, teas, beers, and ales"},{"CategoryName":"Condiments","Description":"Sweet and savory sauces, relishes, spreads, and seasonings"},{"CategoryName":"Confections","Description":"Desserts, candies, and sweet breads"}]

I have the following model for Category(from Northwind):
```
namespace SampleWebApiApp.Models
{
using System;
using System.Collections.Generic;

public partial class Category
{
public Category()
{
this.Products = new HashSet<Product>();
}

public int CategoryID { get; set; }
public string CategoryName { get; set; }
public string Description { get; set; }
public byte[] Picture { get; set; }

public virtual ICollection<Product> Products { get; set; }
}
}
```
Comments: Unless we hear a good reason why this should be fixed, we should not fix it.

Edited Issue: [CORS] Preflight request failed when there's an HttpOptions route attribute [1050]

$
0
0
This is reported by a customer. See more details here: https://aspnetwebstack.codeplex.com/discussions/441725#editor
Repro attached.

Commented Unassigned: input type = email jquery validate overriding mvc data annotation [1051]

$
0
0
See http://stackoverflow.com/questions/16523525/input-type-email-jquery-validate-overriding-mvc-data-annotation
Comments: When you paste a stackoverflow thread asking for a solution, we are going post a workaround :) Yes: we own unobtrusive, and we are going to look at it, as a bug as well. Thanks for reporting

Edited Issue: input type = email jquery validate overriding mvc data annotation [1051]

$
0
0
When applying the following properties to a model:

```
[Required(ErrorMessage = "Email is required")]
[RegularExpression(RegularExpressions.Email, ErrorMessage = "Email is not valid")]
[DataType(DataType.EmailAddress)]
public string Email { get; set; }
```

1. JQuery validation trumps RegularExpression validation. (Should priority/suppression be allowed).
2. There is no built-in way to localize the validation error from JQuery.

See http://stackoverflow.com/questions/16523525/input-type-email-jquery-validate-overriding-mvc-data-annotation

Edited Issue: Format handlers configuration in web.config after install Web API CORS package [1053]

$
0
0
After installing CORS package, the current behavior is: The handlers config is one line

<handlers><remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" /><remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" /><remove name="ExtensionlessUrlHandler-Integrated-4.0" /><remove name="OPTIONSVerbHandler" /><remove name="TRACEVerbHandler" /><add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /><add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" /><add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /></handlers></system.webServer>

Should format it in multiple lines.


Edited Feature: Update the Web API OWIN adapter to use Microsoft.Owin once it behaves well [1054]

$
0
0
Biggest adoption blockers identified so far are:

1. Potential null refs when computing URIs
2. Doesn't throw when required keys are missing from the environment, or when the environment has the wrong type for a particular key

Commented Unassigned: WebAPI ODataLib dependency invalid [1055]

$
0
0
Currently the WebAPI OData package has a dependency on ODataLib >= 5.5.0-alpha2, however if you use ODataLib 5.5.0-rc1 everything breaks.

The MyGet dependency value should probably be set to =5.5.0-alpha2.
Comments: Hi Omar, thanks for the report - I believe one of the devs on the team is working on a fix for this.

Edited Issue: WebAPI ODataLib dependency invalid [1055]

$
0
0
Currently the WebAPI OData package has a dependency on ODataLib >= 5.5.0-alpha2, however if you use ODataLib 5.5.0-rc1 everything breaks.

The MyGet dependency value should probably be set to =5.5.0-alpha2.

Edited Issue: Implement IODataUrlResolver so that ODataLib can resolve Url references that are part of a batch request [1032]

$
0
0
When doing the following batch request with DataServicesClient:

```
GeneratedDataServicesClient client = new GeneratedDataServicesClient(serviceUrl);
client.Format.UseJson();
BatchCustomer customer = client.BatchCustomer.ToList().First();
Order order = new Order() { Id = 0, PurchaseDate = DateTime.Now };
client.AddToOrder(order);
client.AddLink(customer, "Orders", order);
client.SaveChanges(SaveChangesOptions.Batch);
```

that translates into the following HTTP request:

```
POST BaseUrl/$batch HTTP/1.1
DataServiceVersion: 1.0;NetFx
MaxDataServiceVersion: 3.0;NetFx
Content-Type: multipart/mixed; boundary=batch_77c46244-d02f-4714-9e8d-28dd0910189c
Accept: multipart/mixed
Accept-Charset: UTF-8
User-Agent: Microsoft ADO.NET Data Services
Host: host
Content-Length: 1099
Expect: 100-continue

--batch_77c46244-d02f-4714-9e8d-28dd0910189c
Content-Type: multipart/mixed; boundary=changeset_d758f8a5-20a0-4d01-8c33-0884b8202729

--changeset_d758f8a5-20a0-4d01-8c33-0884b8202729
Content-Type: application/http
Content-Transfer-Encoding: binary

POST BaseUrl/Order HTTP/1.1
Content-ID: 11
DataServiceVersion: 3.0;NetFx
MaxDataServiceVersion: 3.0;NetFx
Content-Type: application/json;odata=minimalmetadata
Accept: application/json;odata=minimalmetadata
Accept-Charset: UTF-8

{"Id":0,"PurchaseDate":"2013-05-06T09:05:44.6392992-07:00"}
--changeset_d758f8a5-20a0-4d01-8c33-0884b8202729
Content-Type: application/http
Content-Transfer-Encoding: binary

POST BaseUrl/BatchCustomer(0)/$links/Orders HTTP/1.1
Content-ID: 12
DataServiceVersion: 3.0;NetFx
MaxDataServiceVersion: 3.0;NetFx
Accept: application/json;odata=minimalmetadata
Accept-Charset: UTF-8
Content-Type: application/json;odata=minimalmetadata

{"url":"$11"}
--changeset_d758f8a5-20a0-4d01-8c33-0884b8202729--
--batch_77c46244-d02f-4714-9e8d-28dd0910189c--
```

The request fails because the $11 reference in the second request of the batch doesn't get resolved properly. The root of the problem is that ODataLib is not able to resolve the Url. In order for ODataLib to be able to properly resolve the Url we need to implement IODataUrlResolver in the ODataMessageWrapper class.

Commented Issue: Implement IODataUrlResolver so that ODataLib can resolve Url references that are part of a batch request [1032]

$
0
0
When doing the following batch request with DataServicesClient:

```
GeneratedDataServicesClient client = new GeneratedDataServicesClient(serviceUrl);
client.Format.UseJson();
BatchCustomer customer = client.BatchCustomer.ToList().First();
Order order = new Order() { Id = 0, PurchaseDate = DateTime.Now };
client.AddToOrder(order);
client.AddLink(customer, "Orders", order);
client.SaveChanges(SaveChangesOptions.Batch);
```

that translates into the following HTTP request:

```
POST BaseUrl/$batch HTTP/1.1
DataServiceVersion: 1.0;NetFx
MaxDataServiceVersion: 3.0;NetFx
Content-Type: multipart/mixed; boundary=batch_77c46244-d02f-4714-9e8d-28dd0910189c
Accept: multipart/mixed
Accept-Charset: UTF-8
User-Agent: Microsoft ADO.NET Data Services
Host: host
Content-Length: 1099
Expect: 100-continue

--batch_77c46244-d02f-4714-9e8d-28dd0910189c
Content-Type: multipart/mixed; boundary=changeset_d758f8a5-20a0-4d01-8c33-0884b8202729

--changeset_d758f8a5-20a0-4d01-8c33-0884b8202729
Content-Type: application/http
Content-Transfer-Encoding: binary

POST BaseUrl/Order HTTP/1.1
Content-ID: 11
DataServiceVersion: 3.0;NetFx
MaxDataServiceVersion: 3.0;NetFx
Content-Type: application/json;odata=minimalmetadata
Accept: application/json;odata=minimalmetadata
Accept-Charset: UTF-8

{"Id":0,"PurchaseDate":"2013-05-06T09:05:44.6392992-07:00"}
--changeset_d758f8a5-20a0-4d01-8c33-0884b8202729
Content-Type: application/http
Content-Transfer-Encoding: binary

POST BaseUrl/BatchCustomer(0)/$links/Orders HTTP/1.1
Content-ID: 12
DataServiceVersion: 3.0;NetFx
MaxDataServiceVersion: 3.0;NetFx
Accept: application/json;odata=minimalmetadata
Accept-Charset: UTF-8
Content-Type: application/json;odata=minimalmetadata

{"url":"$11"}
--changeset_d758f8a5-20a0-4d01-8c33-0884b8202729--
--batch_77c46244-d02f-4714-9e8d-28dd0910189c--
```

The request fails because the $11 reference in the second request of the batch doesn't get resolved properly. The root of the problem is that ODataLib is not able to resolve the Url. In order for ODataLib to be able to properly resolve the Url we need to implement IODataUrlResolver in the ODataMessageWrapper class.
Comments: fixed: https://aspnetwebstack.codeplex.com/SourceControl/changeset/cb1bb63af6c429927f8b6af7f9a402d56c587ac6

Commented Feature: MVC Support Adding HTML Attributes to SelectListItems [9]

$
0
0
I would like the ability to add Html attributes to individual SelectListItems via object htmlAttributes. This would be handy for applying CSS to selected options on render. I have working code for this (using the MVC3 source as the base) that I have used on client websites so it will be easy to integrate.
Comments: This is a great idea, but it can be even better with another overload that instead of just adding data attributes for every SelectListItem, consider adding a function as the parameter that can generate whatever parameter you want to based on the return value of the function. That way you can put together a nice lambda expression that returns a data attribute depending on the value or text of the SelectListItem.

Commented Issue: Make JsonContractResolver a public class [228]

$
0
0
This would enable overriding the ResolvePropertyName method (see Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver) without having to reimplement the entire JsonContractResolver class. I would really like to keep its private property behavior.
Comments: Almost half day trying to understand how WebAPI serialize to JSON just because I want the first letter of JSON key lower case to standardize models in Javascript framework. At first I am stuck at Model Binder but after few hours I realize WebAPI uses MediaTypeFormatter to serialize/deserialize, then I found this. +1 to make it public, but it is really nice if camel case is applied in the JsonContractResolver by default.

Edited Issue: Empty SingleResult cannot be formatted by the ODataFormatter [1040]

$
0
0


public override SingleResult<Customer> GetCustomer(int key)
{
return SingleResult.Create(Enumerable.Empty<Customer>());
}

Commented Issue: Empty SingleResult cannot be formatted by the ODataFormatter [1040]

$
0
0


public override SingleResult<Customer> GetCustomer(int key)
{
return SingleResult.Create(Enumerable.Empty<Customer>());
}
Comments: Returning a 404 response when SingleResult has an empty feed Fixed in https://aspnetwebstack.codeplex.com/SourceControl/changeset/3fd6562cad19160992429ce12f378cdfb03c16e2

Edited Issue: FileExtensionsAttributeAdapter no longer works with jQuery validate [882]

$
0
0
The "Accept" rule in the latest version of jQuery Validate now expects a mime type to be specified, not a file extension.

A new "Extensions" rule has subsequently been added for this purpose.

Note that as of v1.90 both of the above rules are now available separately inside the "Additional Methods" download.

Commented Issue: FileExtensionsAttributeAdapter no longer works with jQuery validate [882]

$
0
0
The "Accept" rule in the latest version of jQuery Validate now expects a mime type to be specified, not a file extension.

A new "Extensions" rule has subsequently been added for this purpose.

Note that as of v1.90 both of the above rules are now available separately inside the "Additional Methods" download.
Comments: The solution: 1. FileExtensions attribute will evaluate to the 'extension' method of JQuery Validation, and Accept attribute will evaluate to the 'accept' method 2. If the 'extension' method is not present (using MVC5 with an older version of jquery validation) then the FileExtensions attribute would use the 'accept' method, and Accept attribute will be ignored on the client side altogether. Fixed in https://aspnetwebstack.codeplex.com/SourceControl/changeset/803b6de9af1b4e77f805071bd9e521687903681b

Created Issue: JQuery Validation plugin - include additional-methods file [1057]

$
0
0
The JQuery Validation plugin is normally bundled with a file named additional-methods.js that adds some more validation methods to the basic ones that are in the plugin.

Two of which, 'accept' (for validating mime-types on input[type=file]) and 'extension' for validating file extensions (again, on input[type=file]), have support within MVC in the form of validation attributes (FileExtensionsAttribute and AcceptAttribute)

Currently the templates provided does not include that additional file, hence out-of-the-box these validation attributes only apply on server-side.

A fix would be to either add the nuget-package for the additional methods into the template, or to update the JQuery.validation nuget package to always include the additional methods file.
The default Bundle for jquaeyval should be updated as well.

Viewing all 7215 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>