Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EntityMapping"/> class.
 /// </summary>
 /// <param name="type">Type.</param>
 /// <param name="parentMapping">Parent mapping.</param>
 public EntityMapping(string type, Mapping parentMapping)
 {
     _Type = type;
     _Ids = new PrimaryKeyMappingCollection();
     _Attributes = new AttributeMappingCollection();
     _Attributes.TypeName = type;
     _References = new ReferenceMappingCollection();
     _ParentMapping = parentMapping;
 }
        private string GetWhereId(PrimaryKeyMappingCollection pkms)
        {
            string[] contraints = new string[pkms.Count];
            for (int i = 0; i < pkms.Count; i++)
            {
                contraints[i] = String.Concat(
                    _Dialect.FormatAttribute(pkms[i].Field),
                    " = ",
                    _Driver.FormatParameter("Id" + i.ToString()));
            }

            return String.Concat("( ", String.Join(" AND ", contraints), " )");
        }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EntityMapping"/> class.
 /// </summary>
 public EntityMapping()
 {
     _Ids = new PrimaryKeyMappingCollection();
     _Attributes = new AttributeMappingCollection();
     _References = new ReferenceMappingCollection();
 }