2 using System.Collections.Generic;
5 namespace Deveel.Data.Mapping {
12 TableName = tableName;
13 memberMappings =
new Dictionary<string, MemberMapping>();
18 public Type Type {
get;
private set; }
20 public string TableName {
get;
private set; }
22 public IEnumerable<MemberMapping> Members {
23 get {
return memberMappings.Values.AsEnumerable(); }
26 public IEnumerable<string> MemberNames {
27 get {
return memberMappings.Keys.AsEnumerable(); }
35 if (String.IsNullOrEmpty(memberName))
36 throw new ArgumentNullException(
"memberName");
39 if (!memberMappings.TryGetValue(memberName, out mapping))
46 if (String.IsNullOrEmpty(memberName))
47 throw new ArgumentNullException(
"memberName");
49 return memberMappings.ContainsKey(memberName);
54 return IsMemberMapped(memberName);
58 var member = GetMember(memberName);
62 return member.PrimaryKey;
66 var member = GetMember(memberName);
70 return member.UniqueKey;
readonly Dictionary< string, MemberMapping > memberMappings
bool IsUniqueKey(string memberName)
bool IsMemberMapped(string memberName)
bool IsColumn(string memberName)
void AddMember(MemberMapping mapping)
bool IsPrimaryKey(string memberName)
MemberMapping GetMember(string memberName)
TypeMapping(MappingModel model, Type type, string tableName)