Exemplo n.º 1
0
        public void WhenAssignManyToManyRelationThenActionShouldReuseSameInstanceOfMapper()
        {
            var keyType    = typeof(string);
            var hbmMap     = new HbmMap();
            var hbmMapping = new HbmMapping();
            var mapper     = new MapKeyRelation(keyType, hbmMap, hbmMapping);
            IMapKeyManyToManyMapper parameterCall1 = null;
            IMapKeyManyToManyMapper parameterCall2 = null;

            mapper.ManyToMany(mkm =>
            {
                parameterCall1 = mkm;
            });
            mapper.ManyToMany(mkm =>
            {
                parameterCall2 = mkm;
            });

            parameterCall1.Should().Be.SameInstanceAs(parameterCall2);
        }
Exemplo n.º 2
0
 public void MapMapKeyManyToMany(IModelInspector modelInspector, PropertyPath member, IMapKeyManyToManyMapper map)
 {
 }
Exemplo n.º 3
0
        public static void MapMapKeyManyToMany(IModelInspector modelInspector, PropertyPath member, IMapKeyManyToManyMapper map)
        {
            var property    = member.LocalMember as PropertyInfo;
            var keytypename = property.PropertyType.DetermineDictionaryKeyType().Name;

            map.Column(keytypename + "Id");
        }
Exemplo n.º 4
0
 public void InvokeCustomizers(PropertyPath member, IMapKeyManyToManyMapper mapper)
 {
     InvokeCustomizers(mapKeyManyToManyCustomizers, member, mapper);
 }
 protected virtual void OnBeforeMapMapKeyManyToMany(IModelInspector modelInspector, PropertyPath member, IMapKeyManyToManyMapper mapKeyManyToManyCustomizer)
 {
 }
Exemplo n.º 6
0
 protected virtual void OnAfterMapMapKeyManyToMany(IModelInspector modelInspector, PropertyPath member, IMapKeyManyToManyMapper mapKeyManyToManyCustomizer)
 {
 }
 /// <summary>
 /// Maps a mixed list of columns and formulas.
 /// </summary>
 /// <param name="mapper">The mapper.</param>
 /// <param name="columnOrFormulaMapper">The mappers for each column or formula.</param>
 /// <remarks>Replaces any previously mapped column or formula.</remarks>
 public static void ColumnsAndFormulas(
     this IMapKeyManyToManyMapper mapper,
     params Action <IColumnOrFormulaMapper>[] columnOrFormulaMapper)
 {
     CallColumnsAndFormulas(mapper, columnOrFormulaMapper);
 }
 /// <summary>
 /// Maps many formulas.
 /// </summary>
 /// <param name="mapper">The mapper.</param>
 /// <param name="formulas">The formulas to map.</param>
 /// <remarks>Replaces any previously mapped column or formula.</remarks>
 public static void Formulas(this IMapKeyManyToManyMapper mapper, params string[] formulas)
 {
     CallFormulas(mapper, formulas);
 }