Questions tagged [web.api]

The tag has no usage guidance.

-1
votes
0answers
34 views

Using EF 6 in ASP.NET Core Web Api - Database first approach (EDMX)

I am trying to find the way to use EF 6 in .Net Core web API using DB first approach (with EDMX). I have found enough blogs how to use EF 6 with .net core, but they all refer to code-first approach... ...
0
votes
0answers
35 views

Placing my API in a different area of my Asp.net application

I'm creating a web application with a web api, both will be placed in the same project. I've already made the api work, but since they will all be in the same application, I'd like to put all my APi ...
1
vote
1answer
38 views

Web api error when calling from angular after hosting on IIS (Post method only)

Asp .net webapi call perfectly working when hosted on debugging mode ( I can call from angular,post man etc.. no issue found). When i host same web api on IIS and called post methods from angular its ...
0
votes
1answer
43 views

Enable CORS from a specific origin on Topshelf hosted service

I'm sure this is a duplicate but none of the answers I've found appears to be working. I have a web.api hosted as a windows service and I need to allow CORS to two specific origins. I have this in ...
1
vote
1answer
64 views

Error : UrlHelper.Link must not return null

I am new to c#.net. I am creating REST Services here I want to create Post service data is Inserted in database but in response I got this error UrlHelper.Link must not return null.. My Code [...
0
votes
1answer
28 views

CreatedAtRoute results a null link

Somewhy CreatedAtRoute results a proper 201 code in CreatedAtRoute object, but 500 errorcode in reply to postman. Iv read most of CreatedAtRoute questions and allready tryed several solutions - but ...
0
votes
0answers
22 views

to display a particular record through get method in asp.net web api

i want to get a particular data from the dataentitymodel, but when i use the uri:http://localhost:49203/api/AccountTypes/1 it shows the result of all the tabe the code is here //get ...
0
votes
2answers
144 views

How to send File Object to Web api using POST call in Xamarin forms.?

I need to make POST call from my xamarin forms app where i need to upload File object as it is to API using POST Call.Is there any way to make it possible.
0
votes
0answers
23 views

Setting a cookie for the ignoring subdomain C#

I have a webpage: portal.myurl.com.au which I want it to set a cookie domain=myurl.com.au so that I can access the cookie on files.myurl.com.au I am using Chrome as the client browser, and my C# ...
0
votes
0answers
215 views

Json to C# not de-serializing currency symbol correctly

I'm using C# web.api with .net core 2.1. I have a Json property in an appsetting.json file and when it's deserialized into c#, via AddOptions, the £ symbol is changed to � Can I add a setting to ...
0
votes
1answer
161 views

Problem with GlobalConfiguration.Configure(WebApiConfig.Register) and umbraco

Hi I have one Umbraco project and 1 web api project using Umbraco. I have installed on the second one UmbracoCms.Core and I have a controller that is UmbracoAppiController public class ...
4
votes
1answer
71 views

Pipe Character in ASP.NET route parameter causing 404

We have a ASP.NET Web API method with the following route: [System.Web.Http.Route( "api/MergeFields/{id}" )] public virtual string Get( string id ) { ... } On most of our servers, if the {id} ...
1
vote
0answers
19 views

Exist some way to load my policys from DB to my web api .net core?

Exist some wat to load my policys from DB, some code like public void ConfigureServices(IServiceCollection services) { var appPolicys= GetPolicysFromDB(SOME_PARAMETER); foreach(var ...
1
vote
1answer
104 views

.net core N-layered Web Api using automapper to pass DTOs between controller and service layers error

I'm new to web api , and layered architecture below is the structure of my entire project i want to know how to pass entities from controller to service and get back again from service to controller ...
0
votes
0answers
67 views

How can I take the result of FIleContentResult, RestSharp, C#, Asp.Net Core

I have music service, that gets the file stream of music, and it is working perfectly: [HttpGet("GetMusicFileByIdAsync")] public async Task<IActionResult> GetMusicFileByIdAsync([FromQuery]Guid ...
0
votes
0answers
66 views

Web.api hits wrong action

The controller called Nfce has mandatory parameters that must be passed to the routes. The problem is that the route from the method "ConsultaRejeitada" is never reached. All queries end up falling on ...
1
vote
1answer
441 views

Async execution in Web.Api .NET Core controller

Is there different beetwen calling method of service with async/await: [HttpPost] public async Task<SmthResponce> AddSmth([FromBody] SmthRequest smthRequest) { return await ...
0
votes
0answers
53 views

C# Property Binding Order

I am using a c# Web API and I have a one class as below and it has below defined properties. This same class has been used in my Get/Post User info call. Basically when we storing the value in ...
0
votes
0answers
44 views

WebApi controler fails - thread culture issue

I have a controller method that fails on the return statement [HttpGet("{id}")] public UserModel Get(int id) { System.Threading.Thread.CurrentThread.CurrentCulture = new System....
0
votes
1answer
271 views

ASP.net WebApi POST returns 405 error

I'm building Angular 5 app with asp.net backend. I want to send POST request, I tested it via Postman and it works absolutely fine, however, when I try to do it inside Angular I get 405 error. I user ...
1
vote
2answers
4k views

No MediaTypeFormatter is available to read an object of type from content with media type 'text/html'

Running Core 2.0 Web Api. Everything works fine locally when I post via Postman to my controller. However I get: No MediaTypeFormatter is available to read an object of type 'Message' from ...
0
votes
1answer
831 views

How to add structuremap container configuration to Web Api Startup file

I have a SctructureMap container already set up (in a separate project) like so: public class Container { public static StructureMap.Container Current { get; private set; } ...
0
votes
1answer
270 views

ASP.NET Web API programmatic way of applying IQueryable to an Entity Framework query

We can accept an OData query from the URL with web API and that is as simple as: [EnableQuery] public IQueryable<EFType> GetBuiltInTypes() { return db.EFTypes; } The data is restricted in ...
0
votes
1answer
27 views

Web.Api help information for IHttpActionResult and an object

I am using web.api and the help to display the interface for the end user. The method I have is as follows: public IHttpActionResult Initialize([FromBody]Initialize initalize) { return ...

http://mssss.yulina-kosm.ru