Implemented ability to have server settings. Currently cache directory is there but it is not configurable (or used in this commit)

This commit is contained in:
Joseph Milazzo 2021-01-23 09:01:10 -06:00
parent 8220709b4c
commit 18385a4f80
20 changed files with 2854 additions and 6 deletions

View file

@ -0,0 +1,28 @@
using System.Collections.Generic;
using API.DTOs;
using API.Entities;
using AutoMapper;
namespace API.Helpers.Converters
{
public class ServerSettingConverter : ITypeConverter<IEnumerable<ServerSetting>, ServerSettingDto>
{
public ServerSettingDto Convert(IEnumerable<ServerSetting> source, ServerSettingDto destination, ResolutionContext context)
{
destination = new ServerSettingDto();
foreach (var row in source)
{
switch (row.Key)
{
case "CacheDirectory":
destination.CacheDirectory = row.Value;
break;
default:
break;
}
}
return destination;
}
}
}