asp.net-core

How to fix network error in react-native when access localhost api

妖精的绣舞 提交于 2021-02-20 06:50:06
问题 We're trying to connect to an API (.net core 2.2) from react-native (version 0.59), via localhost, both apparently running on the same ip, different ports, react-native on port 8080, and the api on the 44344, the issue happens the moment we fetch the url from react-native We’ve also tested running the url from Postman and everything seems ok, also from any of the web browser installed (safari/chrome), even we tested the browser INSIDE react-native iOS, and it works. Any api running outside

Actions require unique method/path combination for Swagger

有些话、适合烂在心里 提交于 2021-02-20 06:32:03
问题 I have 2 HTTP GET method in same controller and give me this error HTTP method "GET" & path "api/DataStore" overloaded by actions - DPK.HostApi.Controllers.DataStoreController.GetByIdAsync (DPK.HostApi),DPK.HostApi.Controllers.DataStoreController.GetAllAsync (DPK.HostApi). Actions require unique method/path combination for Swagger 2.0. My Controller : [Route("api/[controller]")] [ApiController] public class DataStoreController : ApiControllerBase { private readonly IDataStoreService

Actions require unique method/path combination for Swagger

和自甴很熟 提交于 2021-02-20 06:30:24
问题 I have 2 HTTP GET method in same controller and give me this error HTTP method "GET" & path "api/DataStore" overloaded by actions - DPK.HostApi.Controllers.DataStoreController.GetByIdAsync (DPK.HostApi),DPK.HostApi.Controllers.DataStoreController.GetAllAsync (DPK.HostApi). Actions require unique method/path combination for Swagger 2.0. My Controller : [Route("api/[controller]")] [ApiController] public class DataStoreController : ApiControllerBase { private readonly IDataStoreService

IdentityServer4 LocalApi with custom policy in .NET Core 3.1

微笑、不失礼 提交于 2021-02-20 05:07:33
问题 I'm trying to use the "LocalApi" feature of IdentityServer4 with some custom Policies. I have an API (hosted on the same application instance as IdentityServer4) that is divided into three parts (Server, Manager, Product) and for three clients (Server, Manager, Product). Client can only call the devoted part of the API and I would do this with Policies based on scopes. So I have the following: Starup: services.AddLocalApiAuthentication(); // Add API hosted on same application than

IdentityServer4 LocalApi with custom policy in .NET Core 3.1

自古美人都是妖i 提交于 2021-02-20 05:06:53
问题 I'm trying to use the "LocalApi" feature of IdentityServer4 with some custom Policies. I have an API (hosted on the same application instance as IdentityServer4) that is divided into three parts (Server, Manager, Product) and for three clients (Server, Manager, Product). Client can only call the devoted part of the API and I would do this with Policies based on scopes. So I have the following: Starup: services.AddLocalApiAuthentication(); // Add API hosted on same application than

IdentityServer4 LocalApi with custom policy in .NET Core 3.1

两盒软妹~` 提交于 2021-02-20 05:06:14
问题 I'm trying to use the "LocalApi" feature of IdentityServer4 with some custom Policies. I have an API (hosted on the same application instance as IdentityServer4) that is divided into three parts (Server, Manager, Product) and for three clients (Server, Manager, Product). Client can only call the devoted part of the API and I would do this with Policies based on scopes. So I have the following: Starup: services.AddLocalApiAuthentication(); // Add API hosted on same application than

Jquery Datatable data to mvc controller

佐手、 提交于 2021-02-20 04:34:25
问题 Hi im having some troubles trying to send my Datatable Data to my controller using ajax. I have a datatable like this : <table class=" w-100 mr-3 ml-3" id="mytable"> <thead> <tr> <th class="text-left">Code</th> <th class="text-left">Date</th> <th class="text-left">Colocacion</th> <th class="text-left">Amount</th> <th class="text-left">Bank</th> <th class="text-left">Company</th> </tr> </thead> <tbody> @foreach (var obj in Model.List) { <tr> <td class="text-left">@obj.Code</td> <td class="text

File Upload in Asp.net core 2.0 issue creating 0 byte Image

不想你离开。 提交于 2021-02-20 04:23:45
问题 I, am using angular 5, with asp.net core 2.0. I, am trying to upload the file to the server. The code update the file to the server. But with 0 kb of data and sometime it upload the file. The file size is not large. Its in KB. Here is the Angular code public QuestionPostHttpCall(_questionPhotoVM: QuestionPhotoViewModel): Observable<GenericResponseObject<QuestionPhotoViewModel[]>> { const formData: FormData = new FormData(); formData.append('FileUpload', _questionPhotoVM.FileUpload); formData

Debug level information fails to output in VS Code

谁说我不能喝 提交于 2021-02-20 04:01:47
问题 In the ConfigureServices method I'm using: var loggerFactory = new LoggerFactory(); loggerFactory.AddDebug(); However, use of LogDebug() fails to output to the debug console. 回答1: Rather than rely on AddDebug()... specify the minimum log level with AddConsole() and the debug level information outputs to the console as expected: loggerFactory.AddConsole(LogLevel.Debug); This works because the methods AddConsole(), AddDebug() etc. only specify where to log information. The issue is discussed in

Using signalR in asp.net core, how do I change the userID convention to use the users email address instead of default userId?

心已入冬 提交于 2021-02-20 04:01:36
问题 Im using <PackageReference Include="Microsoft.AspNetCore.SignalR.Core" Version="1.1.0" /> in an asp.net core web api. I can see by default that if I want to send a specific user a message I can call a method such as _hub.Clients.User("c5MOTEmXsEZjoVf-y_sVQD_g-yBis9fvLMbyNJX3M31").SendAsync("MessageUpdated", "ee"); However, I would like to know, is there any way to change this such that I can instead pass in a different value for the userId? For example, users email address instead? Is this