< Summary

Class:SVETA.Api.Data.DTO.ConfigurationValueTypeDTO
Assembly:SVETA.Api
File(s):/opt/dev/sveta_api_build/SVETA.Api/Data/DTO/ConfigurationDTO.cs
Covered lines:0
Uncovered lines:8
Coverable lines:8
Total lines:60
Line coverage:0% (0 of 8)
Covered branches:0
Total branches:0

Metrics

MethodLine coverage Branch coverage
.ctor()0%100%
.ctor(...)0%100%
get_Id()0%100%
get_Name()0%100%

File(s)

/opt/dev/sveta_api_build/SVETA.Api/Data/DTO/ConfigurationDTO.cs

#LineLine coverage
 1using SVETA.Api.Helpers;
 2using System;
 3using System.Collections.Generic;
 4using System.Linq;
 5using System.Text;
 6using System.Threading.Tasks;
 7using WinSolutions.Sveta.Server.Data.DataModel.Entities;
 8using System.ComponentModel.DataAnnotations;
 9using SVETA.Api.Validation;
 10
 11namespace SVETA.Api.Data.DTO
 12{
 13    public class ConfigurationResponseDTO
 14    {
 15        public ConfigurationResponseDTO() { }
 16        public ConfigurationResponseDTO(Configuration data)
 17        {
 18            Id = data.Id;
 19            Section = data.Section;
 20            Key = data.Key;
 21            Encrypted = data.Encrypted;
 22            ValueType = new ConfigurationValueTypeDTO(data.ValueType);
 23            Value = data.Encrypted ? SymmetricCrypto.DecryptData(Convert.FromBase64String(data.Value)) : data.Value;
 24            Description = data.Description;
 25        }
 26
 27        public long Id { get; set; }
 28        public string Section { get; set; }
 29        public string Key { get; set; }
 30        public bool Encrypted { get; set; }
 31        public ConfigurationValueTypeDTO ValueType { get; set; }
 32        public string Value { get; set; }
 33        public string Description { get; set; }
 34    }
 35
 36    public class ConfigurationValueTypeDTO
 37    {
 038        public ConfigurationValueTypeDTO() { }
 039        public ConfigurationValueTypeDTO(ConfigurationsDataType data)
 040        {
 041            Id = data.Id;
 042            Name = data.Name;
 043        }
 044        public long Id { get; set; }
 045        public string Name { get; set; }
 46    }
 47    public class ConfigurationRequestDTO
 48    {
 49        public string Section { get; set; }
 50        [Required (ErrorMessage = "Название ключа не может быть пустым")]
 51        public string Key { get; set; }
 52        public bool Encrypted { get; set; }
 53        [DigitValidate (CanBeZero = false, CanBeNegative = true)]
 54        [Display(Name = "Тип значения")]
 55        public long ValueTypeId { get; set; }
 56        [Required(ErrorMessage = "Значение ключа не может быть пустым")]
 57        public string Value { get; set; }
 58        public string Description { get; set; }
 59    }
 60}

Methods/Properties

.ctor()
.ctor(...)
get_Id()
get_Name()