asp.net-web-api

Web Audio Api precise looping in different browsers

余生颓废 提交于 2021-01-28 11:16:08
问题 So what I want is to have constant looping interchanging from different audio sources. For demo purpose I made a little puzzle game - you align numbers in order from 0 to 8 and depending on how you align them different loops are playing. I managed to get the result I want on Chrome Browser, but not on Safari or Firefox. I tried adding a different audio destination or multiple audio contexts but no matter what loop just stops after one iteration in Safari and other browsers except for Chrome.

ASP.NET Core API ISO8601 not parsed in local time when suffix is 'Z'

强颜欢笑 提交于 2021-01-28 10:17:51
问题 Scenario: I have a REST-API that takes a POST-Request. As Body-Data there is passed a Datetime in ISO8601 Format. { "validate": "2019-12-02T23:00:00Z", "configuration": {}, "sortId": 1 } With Modelbinding in MVC the Datetime gets parsed automaticly. The variable should be in the local timezone of the api-server. In this case Europe/Berlin. I would expect the time to be (refering to the example) to be on 2019-12-03:00:00:00. But this is not the case. It is still one hour off. But when i post

ASP.NET Core API ISO8601 not parsed in local time when suffix is 'Z'

旧街凉风 提交于 2021-01-28 10:16:15
问题 Scenario: I have a REST-API that takes a POST-Request. As Body-Data there is passed a Datetime in ISO8601 Format. { "validate": "2019-12-02T23:00:00Z", "configuration": {}, "sortId": 1 } With Modelbinding in MVC the Datetime gets parsed automaticly. The variable should be in the local timezone of the api-server. In this case Europe/Berlin. I would expect the time to be (refering to the example) to be on 2019-12-03:00:00:00. But this is not the case. It is still one hour off. But when i post

Web api authorization by capturing client's service account name

隐身守侯 提交于 2021-01-28 09:14:52
问题 All, I am having an issue with implementing authorization on one of my web api controller action. This is a .net framework 4.6.1 app and an MVC 5 application makes calls into this web api. We implement windows authentication both on the client(MVC5) and web api. Both client and server use the same service account(The account name the app pool runs under) and these are on separate servers. Users of the client app is authenticated using AD account before they get to the MVC app section that

How to fix System.Data.SqlClient.SqlException : “Login failed for user ”xx\xxxx$“”

坚强是说给别人听的谎言 提交于 2021-01-28 09:13:10
问题 I ran a web app on IIS and I got a System.Data.SqlClient.SqlException: "Login failed for user'domain\account$'". This is a exception when the function DbMigrator.Update() is called private readonly DbMigrationsConfiguration<MyContext> _config; public ContextInitializer(string connectionString) { _config = new Configuration() { TargetDatabase = new DbConnectionInfo(connectionString, "System.Data.SqlClient") }; } ... public void InitializeDatabase(MgmtStudioContext context) { var migrator = new

Cannot implicitly convert type system.Data.EnumerableRowCollectio to System.collection.Generic.Ienumerable

为君一笑 提交于 2021-01-28 08:12:40
问题 this is my code public IEnumerable<TestUser> Getdata() { //return new string[] { "value1", "value2" }; TestUserBl tstusr = new TestUserBl(); DataTable dt = new DataTable(); dt = tstusr.TestUserSel(); return dt.AsEnumerable(); } getting error Cannot implicitly convert type 'System.Data.EnumerableRowCollection' to 'System.Collections.Generic.IEnumerable'. An explicit conversion exists (are you missing a cast?) 回答1: Actually DataTable.AsEnumerable() gives you EnumerableRowCollection as the error

ASP.NET Core handling JSON deserialization problems

与世无争的帅哥 提交于 2021-01-28 05:15:21
问题 I would like to change default behavior of invalid JSON request handling in ASP.NET Core. I have this model: public class Model { public Guid Id { get; set; } } And when I send this request with this body { "Id": null } It returns this error message: "Error converting value {null} to type 'System.Guid'. Path 'Id', line 2, position 11." Of course this is absolutely logical but I want Id to be set to default value (Guid.Empty) instead of failing request. I have added this json config in Startup

Is there a way to use Identity Server features in asp.net core 3.1 Rest-API

拥有回忆 提交于 2021-01-28 02:34:37
问题 I’m working in a project with Rest-API in the server by using asp.net core 3.1, angular as front for single page application. From each client, the user would need to supply their username and password in order to access protected parts of the web API. I would like to use the features of Identity Server to access the ASP.NET Core Identity UserManager, RoleManager, and SignInManagers to determine if the supplied username and password is valid. I haven't ever been done this before and I tried

Is there a way to use Identity Server features in asp.net core 3.1 Rest-API

心不动则不痛 提交于 2021-01-27 20:50:23
问题 I’m working in a project with Rest-API in the server by using asp.net core 3.1, angular as front for single page application. From each client, the user would need to supply their username and password in order to access protected parts of the web API. I would like to use the features of Identity Server to access the ASP.NET Core Identity UserManager, RoleManager, and SignInManagers to determine if the supplied username and password is valid. I haven't ever been done this before and I tried

Dotnet Core API - Get the URL of a controller method

雨燕双飞 提交于 2021-01-27 15:01:01
问题 I'm developing an API and it has two Controllers: PicturesController and AccountController . There's a method on PicturesController that returns an image and I'd like to know how to get its URL. On another PicturesController method, I got the URL using the code bellow: var url = Url.RouteUrl("GetPicture", new { id = picture.Id }, Request.Scheme); But I need to get the URL of the same method, however from another controller ( AccountController ). I tried the following code, but it results null