Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

asp.net-web-api

How to inject service into custom ActionFilterAttribute (Web API)?

September 5, 2022 by Magenaut

I tried this answer: [https://stackoverflow.com/questions/18406506/custom-filter-attributes-inject-dependency][1] to implement ActionFilterAttribute (System.Web.Http.Filters) for Web API project (not MVC). But my custom attribute never called in controller. I would be grateful for any advice.

Categories ASP.NET, Q&A Tags .net, asp.net, asp.net-web-api Leave a comment

How to display body as html forms using Swagger in ASP.NET Core

September 5, 2022 by Magenaut

In Swagger is it possible to have the body represented as HTML forms as opposed to a JSON string? and how would one achieve this?

Categories ASP.NET, Q&A Tags asp.net, asp.net-web-api, swagger, swagger-ui Leave a comment

How to transform an object during conversion to json?

September 5, 2022 by Magenaut

I have a flat DTO object with ~500 fields that is returned via an API call. The .NET machinery converts it to JSON and all is good. It looks like this:

Categories ASP.NET, Q&A Tags .net, asp.net, asp.net-web-api, c# Leave a comment

How to automatically set default value of API model’s property with value from appSettings.json?

September 5, 2022 by Magenaut

I’m creating a web API in Core 3.1 and I have PagingParams model that I will use on many controller actions. The model has PageNumber and PageSize parameters, both of which have a default value:

Categories ASP.NET, Q&A Tags asp.net, asp.net-core, asp.net-web-api, c# Leave a comment

Prevent SQL Server Connection in ASP.Net Integration test

September 4, 2022 by Magenaut

I have a standard ASP.Net Web API Project with a DB setup that looks something like this:

Categories ASP.NET, Q&A Tags asp.net, asp.net-web-api, c#, integration-testing, sql-server Leave a comment

Problem with SevenZipSharp. 7z.dll library not found even path to lib defined

September 4, 2022 by Magenaut

I’m creating ASP.NET Web Application. I need in it to extract some ‘7z’ files.

Categories ASP.NET, Q&A Tags .net, asp.net, asp.net-web-api, c#, sevenzipsharp Leave a comment

Saving email to the directory with specified file name is not working in .NET 5.0

September 4, 2022 by Magenaut

I am trying to follow the approach suggested in a post by Allan Eagle in code-project. This same approach was working fine up until .NET Core 3.1, but not with .NET 5.0 . Here is the save method I created,

Categories ASP.NET, Q&A Tags .net-5, asp.net, asp.net-mvc, asp.net-web-api, c# Leave a comment

Attachment uploaded to Azure devops through Rest api is not opening

September 4, 2022 by Magenaut

Hi i have followed Microsoft Doccument and uploaded Attachment devops and successfully attached it to work item. but when i dowloaded the file from devops userinteface file ish showing but not able to open it.
here is code

Categories ASP.NET, Q&A Tags asp.net, asp.net-web-api, azure-devops, azure-devops-rest-api, c# Leave a comment

Select data from multiple table with Entity Framework

September 4, 2022 by Magenaut

I am able to select data from two tables, But I am getting partial result only while retrieving data from three tables.

Categories ASP.NET, Q&A Tags asp.net, asp.net-web-api, entity-framework, rest Leave a comment

Is there a way in a child controller to hide actions from a base generic controller?

September 4, 2022 by Magenaut

There is a Controller that has 7 actions that are reused by all other child controllers. It is possible to hide endpoints, if it is necessary, using “path order” in the attribute. The following code hides the parent action:

Categories ASP.NET, Q&A Tags asp.net, asp.net-apicontroller, asp.net-core, asp.net-web-api, c# Leave a comment
Older posts
Page1 Page2 … Page29 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress