コード例 #1
0
        public void TestGetColumnNameMultiEntity()
        {
            string companyResult = DynamicPropertyHelper.GetColumnName(typeof(PropertyHelperTestCompany), "Name");
            string personResult  = DynamicPropertyHelper.GetColumnName(typeof(TestPerson), "LastName");

            Assert.Equal("name", companyResult);
            Assert.Equal("lastname", personResult);
        }
コード例 #2
0
        public void TestConcurrentInitialization()
        {
            var tasks = new List <Task <string> >();

            for (int i = 0; i < 10; i++)
            {
                tasks.Add(Task.Run(() => DynamicPropertyHelper.GetColumnName <PropertyHelperTestCompany>("Name")));
            }
            Task.WaitAll(tasks.ToArray());
        }
コード例 #3
0
        public void Add(string property, EOperator op, int level, InterRestrictionOperator interOperator, object value)
        {
            string column = DynamicPropertyHelper.GetColumnName <T>(property);

            AddRestriction <T>(column, op, interOperator, level, value);
        }
コード例 #4
0
        public void TestGetColumnName()
        {
            string result = DynamicPropertyHelper.GetColumnName(typeof(PropertyHelperTestCompany), "Id");

            Assert.Equal("id", result);
        }
コード例 #5
0
 protected override Expression VisitMember(MemberExpression expression)
 {
     _column = DynamicPropertyHelper.GetColumnName(expression.Member.DeclaringType, expression.Member.Name);
     return expression;
 }
コード例 #6
0
        public void TestColumnConfigProvider()
        {
            string test1Column = DynamicPropertyHelper.GetColumnName(typeof(TestAddress), nameof(TestAddress.Test1));

            Assert.Equal(MockColumnConfigProvider.SUCCESS_COLUMN_NAME, test1Column);
        }