Nohxi
Nohxi
CC#
Created by Nohxi on 3/25/2024 in #help
✅ Directory path
Thank you appreciate it alot. Have been stuck for somewhat 4 hours now
40 replies
CC#
Created by Nohxi on 3/25/2024 in #help
✅ Directory path
that actually did the job
40 replies
CC#
Created by Nohxi on 3/25/2024 in #help
✅ Directory path
Hahaha
40 replies
CC#
Created by Nohxi on 3/25/2024 in #help
✅ Directory path
ty though
40 replies
CC#
Created by Nohxi on 3/25/2024 in #help
✅ Directory path
injected in startup : builder.Services.AddScoped<IParameters, Parameters>();
40 replies
CC#
Created by Nohxi on 3/25/2024 in #help
✅ Directory path
Parameter dir namespace Definition.Api.Parameters { public class Parameters : IParameters { private readonly IConfiguration configuration; public Parameters(IConfiguration configuration) { this.configuration = configuration; } public string Path => configuration["Path"] ?? ""; } }
40 replies
CC#
Created by Nohxi on 3/25/2024 in #help
✅ Directory path
Interface `namespace Definition.Infrastructure { public interface IParameters { string Path { get; } } }z
40 replies
CC#
Created by Nohxi on 3/25/2024 in #help
✅ Directory path
Repo public class DefinitionRepository : IDefinitionRepository { private readonly IParameters parameters; public DefinitionRepository(IParameters parameters) { this.parameters = parameters; } public async Task<IEnumerable<DefinitionJson>> Get() { string fullPath = Path.Combine(parameters.Path); var json = File.ReadAllText(fullPath); var searchMethod = JsonConvert.DeserializeObject<List<DefinitionJson>>(json); return searchMethod; } }
40 replies
CC#
Created by Nohxi on 3/25/2024 in #help
✅ Directory path
Sure let me organize the code
40 replies
CC#
Created by Nohxi on 3/25/2024 in #help
✅ Directory path
{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, "AllowedHosts": "*", "ConnectionStrings": { "AppDbConnectionString": "server=localhost;database=db;User=root;Password=admin;" }, "Path": "/Users/an/Desktop/Development/Project/Project.Api/App_data/data.json" }
40 replies
CC#
Created by Nohxi on 3/25/2024 in #help
✅ Directory path
originally from appsettings.json
40 replies
CC#
Created by Nohxi on 3/25/2024 in #help
✅ Directory path
complete different path
40 replies
CC#
Created by Nohxi on 3/25/2024 in #help
✅ Directory path
parameters.Path "/Library/Frameworks/Mono.framework/Commands:/Applications/Visual Studio.app/Contents/MacOS:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin:/usr/local/bin:~/.dotnet/tools:/usr/local/share/dotnet"
40 replies
CC#
Created by Nohxi on 3/25/2024 in #help
✅ Directory path
It is , that is why I am wondering how pathing works on iOS or dotnet
40 replies