.Net Core API read content from Json File

Posted by Ishan7 under .NET Core on 12/30/2020 | Points: 10 | Views : 486 | Status : [Member] | Replies : 0
I am trying to read content from a json file in .Net core API and assign to a list and use it for doing business logic.

API Layers:

Project -> Business -> Repository -> DB

I need to read content from a json file in the Business layer. File content will not change frequently. I am thinking of reading the file in the Business layer class constructor.


Do I need to keep this file in App_Data folder?
Can I use the HttpContextAccessor in the business layer constructor and read the content?
Can someone help in providing the best way to achieve? Please let me know if the question is not clear and I will rephrase it.


(No response found.)

Login to post response