Tag: C#
-
LINQ to Entities does not recognize the method ‘System.Linq.IQueryable
Hi everyone, I ran into the following error today while attempting to use a raw query with entity framework: LINQ to Entities does not recognize the method ‘System.Linq.IQueryable…method, and this method cannot be translated into a store expression I was using FromQuery, and while I’m not too sure what was causing the issue, switching to…
-
Web API 2 – ExceptionMessage=No MediaTypeFormatter is available to read an object of type ‘HttpPostedFileBase’ from content with media type ‘multipart/form-data’.
Hi everyone, I ran into the following error while trying to get image uploads working with Web API 2: ExceptionMessage=No MediaTypeFormatter is available to read an object of type ‘HttpPostedFileBase’ from content with media type ‘multipart/form-data’. I had been trying to copy the following from an mvc controller in another project: public IHttpActionResult Upload(HttpPostedFileBase file,…
-
DbSet does not contain a definition for ‘FromSQL’ and no extension method ‘FromSql’ accepting an argument of type ‘DbSet’ could be found.
Hi everyone, I ran into the following error while attempting to use a custom query with EntityFramework: DbSet does not contain a definition for ‘FromSQL’ and no extension method ‘FromSql’ accepting an argument of type ‘DbSet’ could be found. This one’s pretty straight forward: // Install the following package via nuget Install-package Microsoft.EntityFrameworkCore.Relational //Add the…
-
Include UserId in Login Response (Token) – Web API 2
Hi everyone, A quick post on how to include the user’s id in your login response when using Web API 2. The default response to the /Token request is as follows: { “access_token”: “xxxxxxxxxxxxx_xxxx”, “token_type”: “bearer”, “expires_in”: 1209599, “userName”: “test@test.com”, “.issued”: “Mon, 23 Apr 2018 06:08:03 GMT”, “.expires”: “Mon, 07 May 2018 06:08:03 GMT” }…
-
Unsupported_Grant_Type – MVC Web Api (error)
Hi everyone, I ran into the following error while attempting to authenticate using .NET Web Api: POST http://localhost:63720/Token HTTP/1.1 Host: localhost:63720 Content-Type: application/json Content-Length: 0 HTTP/1.1 400 Bad Request Content-Type: application/json;charset=UTF-8 Date: Mon, 16 Apr 2018 14:18:06 GMT Content-Length: 34 {“error”:”unsupported_grant_type”} This one was pretty straight forward. Ensure that have the correct content-type: Content-Type: application/x-www-form-urlencoded…
-
Exited with code 9009 – Visual Studio Build
Hey everyone, I ran into the following error today while attempting to build a solution: combiner exited with code 9009 It apparently means that a file couldn’t be found. The solution was to simply restart visual studio. I’d been manually adding them to the directory and this is apparently a common cause. See the following…
-
Unilateral receiver not allowed in chained payment is restricted – Adaptive Payment DotNet SDK
Hey everyone, Just an error I ran into today while using the Adaptive Payments SDK for C#/.NET: Unilateral receiver not allowed in chained payment is restricted Thankfully this one is fairly simple – one of the receivers hasn’t confirmed their account. http://stackoverflow.com/a/32816078/522859
-
Could not find part of the path ‘C:xlib’ – Adding new Web API Project
Hey everyone, I ran into the following error when I tried to add a new Web API project in Visual Studio Express 2015 for Web: Could not find part of the path ‘C:xlib’ The workaround for this was to temporarily unbind the project from TFS: File > Source Control > Advanced > Change Source Control…
-
Culture Info Codes
Hey everyone, Just posting a link to this list of culture info codes etc. I was looking for the en-AU one but had a bit of trouble tracking it down. Language Culture Name Display Name Culture Code ISO 639x Value af-ZA Afrikaans – South Africa 0x0436 AFK sq-AL Albanian – Albania 0x041C SQI ar-DZ Arabic…
-
This type of fee payer x isn’t recognized by our system – PayPal Adaptive Payments SDK
Hey everyone, Just another Adaptive Payments SDK error I’ve run into. Error Id: 560027 This type of fee payer x isn’t recognized by our system This one is fairly self explanatory, valid values are as follows: SENDER – Sender pays all fees (for personal, implicit simple/parallel payments; do not use for chained or unilateral payments)…