Skip to content

Instantly share code, notes, and snippets.

@jskeet
Created September 6, 2022 13:31
Show Gist options
  • Select an option

  • Save jskeet/0a07a54f303cc7f796d4a3443ead95de to your computer and use it in GitHub Desktop.

Select an option

Save jskeet/0a07a54f303cc7f796d4a3443ead95de to your computer and use it in GitHub Desktop.
using System.Text.Json;
namespace ContosoCrafts.Website.Services;
public class JsonFileProductService
{
public IWebHostEnvironment WebHostEnvironment { get; }
private string JsonFileName =>
Path.Combine(WebHostEnvironment.WebRootPath, "data", "products.json");
public JsonFileProductService(IWebHostEnvironment webHostEnvironment) =>
WebHostEnvironment = webHostEnvironment;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment