Exemplo n.º 1
0
        private SchemaModel.Column Parse <TKey>(Expression <Func <T, TKey> > selector)
        {
            var body         = (MemberExpression)selector.Body;
            var member       = (PropertyInfo)body.Member;
            var propertyName = member.Name;

            return
                (EntityConfigurationManager.GetTable(((ParameterExpression)body.Expression).Type)
                 .Columns.FirstOrDefault(x => x.Value.PropertyInfo.Name == propertyName)
                 .Value);
        }
Exemplo n.º 2
0
 public EntityConfiguration <T> TableName(string tableName)
 {
     EntityConfigurationManager.GetTable(typeof(T)).Name = tableName;
     return(this);
 }
Exemplo n.º 3
0
 public PropertyConfiguration <TProperty> Property <TProperty>(Expression <Func <T, TProperty> > selector)
 {
     return(new PropertyConfiguration <TProperty>(EntityConfigurationManager.GetTable(typeof(T)),
                                                  ((MemberExpression)selector.Body).Member.Name));
 }