- Added import algorithm - Added FromJsonX() methods to data models - Added possibility to work with temp. database file - Added export processor to handle export process & triggers - Added something changed event e.g. as export trigger - Added possibility to import a JSON export - Updated Git icon
44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using DataModel.Database.Common;
|
|
|
|
namespace DataModel.Database;
|
|
|
|
public sealed class Setting
|
|
{
|
|
[Key]
|
|
public int Id { get; set; }
|
|
|
|
public Guid UniqueId { get; set; }
|
|
|
|
public string Code { get; set; } = string.Empty;
|
|
|
|
public string TextValue { get; set; } = string.Empty;
|
|
|
|
public bool BoolValue { get; set; }
|
|
|
|
public int IntegerValue { get; set; }
|
|
|
|
public Guid GuidValue { get; set; }
|
|
|
|
internal DataContext.JsonUniqueId JsonUniqueId => new(this.Code, this.UniqueId, "Set");
|
|
|
|
internal DataContext.JsonSetting ToJsonSetting() => new()
|
|
{
|
|
UniqueId = this.JsonUniqueId,
|
|
Code = this.Code,
|
|
BoolValue = this.BoolValue,
|
|
GuidValue = this.GuidValue,
|
|
IntegerValue = this.IntegerValue,
|
|
TextValue = this.TextValue,
|
|
};
|
|
|
|
internal static Setting FromJsonSetting(DataContext.JsonSetting jsonSetting) => new()
|
|
{
|
|
UniqueId = jsonSetting.UniqueId.UniqueId,
|
|
Code = jsonSetting.Code,
|
|
BoolValue = jsonSetting.BoolValue,
|
|
GuidValue = jsonSetting.GuidValue,
|
|
IntegerValue = jsonSetting.IntegerValue,
|
|
TextValue = jsonSetting.TextValue,
|
|
};
|
|
} |