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:
parent
8220709b4c
commit
18385a4f80
20 changed files with 2854 additions and 6 deletions
28
API/Helpers/Converters/ServerSettingConverter.cs
Normal file
28
API/Helpers/Converters/ServerSettingConverter.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue