| 1 | using Newtonsoft.Json; |
| 2 | using System; |
| 3 | using System.Collections.Generic; |
| 4 | using System.ComponentModel.DataAnnotations; |
| 5 | using System.ComponentModel.DataAnnotations.Schema; |
| 6 | using System.Linq; |
| 7 | using System.Text; |
| 8 | using System.Threading.Tasks; |
| 9 | |
| 10 | namespace Core.Models |
| 11 | { |
| 12 | ///<summary> |
| 13 | /// |
| 14 | ///</summary> |
| 15 | public class CategoryModel |
| 16 | { |
| 17 | [Key] |
| 18 | public int ID { get; set; } |
| 19 | |
| 20 | ///<summary> |
| 21 | /// |
| 22 | ///</summary> |
| 23 | public string Name { get; set; } |
| 24 | |
| 25 | ///<summary> |
| 26 | /// |
| 27 | ///</summary> |
| 28 | public string IconFile { get; set; } |
| 29 | ///<summary> |
| 30 | /// |
| 31 | ///</summary> |
| 32 | public string Color { get; set; } |
| 33 | ///<summary> |
| 34 | /// |
| 35 | ///</summary> |
| 36 | public bool IsDirectoryMath { get; set; } = false; |
| 37 | ///<summary> |
| 38 | /// |
| 39 | ///</summary> |
| 40 | public string Directories { get; set; } |
| 41 | |
| 42 | ///<summary> |
| 43 | /// |
| 44 | ///</summary> |
| 45 | [NotMapped] |
| 46 | public List<string> DirectoryList |
| 47 | { |
| 48 | get |
| 49 | { |
| 50 | if (string.IsNullOrEmpty(Directories)) return new List<string>(); |
| 51 | return JsonConvert.DeserializeObject<List<string>>(Directories); |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | } |