<commit_before>﻿using Halcyon.HAL.Attributes;
using HateoasTest.Controllers;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using TestHalcyonApi.Controllers;
using TestHalcyonApi.Models;
using Threax.AspNetCore.Halcyon.Ext;
using Threax.AspNetCore.Halcyon.Ext.UIAttrs;

namespace TestHalcyonApi.ViewModels
{
    /// <summary>
    /// A simple test model.
    /// </summary>
    [HalModel]
    [HalSelfActionLink(ThingyController.Rels.Get, typeof(ThingyController))]
    [HalActionLink(ThingyController.Rels.Get, typeof(ThingyController))]
    [HalActionLink(ThingyController.Rels.Update, typeof(ThingyController))]
    [HalActionLink(ThingyController.Rels.Delete, typeof(ThingyController))]
    [HalActionLink(ThingyController.Rels.ListTestSubData, typeof(ThingyController))]
    [HalActionLink(SubThingyController.Rels.Add, typeof(SubThingyController))]
    [HalActionLink(ThingyController.Rels.AuthorizedProperties, typeof(ThingyController))]
    [HalActionLink(ThingyController.Rels.RoleProperties, typeof(ThingyController))]
    [DeclareHalLink(ThingyController.Rels.TestDeclareLinkToRel, typeof(ThingyController))]
    public class ThingyView : Thingy
    {
        public List<ComplexObject> ComplexObjects { get; set; }

        public bool ShowHidden { get; set; }

        //private static readonly Expression<Func<ThingyView, bool>> PropertyToShowExpression = s => s.ShowHidden == true && s.ShowHidden != false || s.ShowHidden == true;
        private static readonly Expression<Func<ThingyView, bool>> PropertyToShowExpression = s => !(s.ShowHidden == true);
        [DisplayExpression(nameof(PropertyToShowExpression))]
        public int PropertyToShow { get; set; }
    }
}<commit_msg>Things<commit_after>﻿using Halcyon.HAL.Attributes;
using HateoasTest.Controllers;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using TestHalcyonApi.Controllers;
using TestHalcyonApi.Models;
using Threax.AspNetCore.Halcyon.Ext;
using Threax.AspNetCore.Halcyon.Ext.UIAttrs;

namespace TestHalcyonApi.ViewModels
{
    /// <summary>
    /// A simple test model.
    /// </summary>
    [HalModel]
    [HalSelfActionLink(ThingyController.Rels.Get, typeof(ThingyController))]
    [HalActionLink(ThingyController.Rels.Get, typeof(ThingyController))]
    [HalActionLink(ThingyController.Rels.Update, typeof(ThingyController))]
    [HalActionLink(ThingyController.Rels.Delete, typeof(ThingyController))]
    [HalActionLink(ThingyController.Rels.ListTestSubData, typeof(ThingyController))]
    [HalActionLink(SubThingyController.Rels.Add, typeof(SubThingyController))]
    [HalActionLink(ThingyController.Rels.AuthorizedProperties, typeof(ThingyController))]
    [HalActionLink(ThingyController.Rels.RoleProperties, typeof(ThingyController))]
    [DeclareHalLink(ThingyController.Rels.TestDeclareLinkToRel, typeof(ThingyController))]
    public class ThingyView : Thingy
    {
        public List<ComplexObject> ComplexObjects { get; set; }

        public bool ShowHidden { get; set; }

        private static readonly Expression<Func<ThingyView, bool>> PropertyToShowExpression = s => s.ShowHidden;
        [DisplayExpression(nameof(PropertyToShowExpression))]
        public int PropertyToShow { get; set; }

        //public int Counter { get; set; }

        //private static readonly Expression<Func<ThingyView, bool>> CounterTest = s => s.Counter > 5;
        //[DisplayExpression(nameof(CounterTest))]
        //public int ShowIfCounterBiggerThan5 { get; set; }

        //public String TextValue { get; set; }

        //private static readonly Expression<Func<ThingyView, bool>> ShowIfTextValueIsBeefTest = s => s.TextValue == "Beef";
        //[DisplayExpression(nameof(ShowIfTextValueIsBeefTest))]
        //public int ShowIfTextValueIsBeef { get; set; }
    }
}
{'fraction_non_alphanumeric': 0.10956175298804781, 'fraction_numerical': 0.00049800796812749, 'mean_word_length': 4.890029325513196, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3620674', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1244, 'n_words': 212}