Hi all,

For the record...

As it seems that those Formula cannot be tested with persistence 
specification I have created two constructors for the mappings, one with 
formula items and another with the rest. In test I am using those with a 
class override and loading manually with

var factory = Fluently.Configure().Database(cfg).Mappings(
                m =>
                    {
                        typeof(ClientMap).Assembly.GetTypes()
                                         .Where(
                                             x =>
                                             x.BaseType != null && 
x.BaseType.IsGenericType
                                             && 
x.BaseType.GetGenericTypeDefinition() == typeof(ClassMap<>)
                                             && !(x == typeof(TimetableMap) 
|| x == typeof(CycleMap)))
                                         .ForEach(map => 
m.FluentMappings.Add(map));
                        m.FluentMappings.Add(typeof(TimetableMapMock));
                        m.FluentMappings.Add(typeof(CycleMapMock));

Regards

Guilllem SolĂ 

On Friday, October 18, 2013 10:03:07 AM UTC+2, guilemsola wrote:
>
> Hi,
>
> I'm using fluent for mapping and testing with PersistenceSpecification and 
> I have one issue with a formula column. On test this formula is used in a 
> "left join on" and Oracle give's me and error.
>
> So I would like to remove this column in the testing project and thinking 
> in using ExposeConfiguration.
>
> For instance, right now I use this to "force" cascades to ALL only in 
> testing project 
>
> .ExposeConfiguration(
>                         configuration => 
>                             .ClassMappings.ForEach(x => 
> x.ReferenceablePropertyIterator.ForEach(r => r.Cascade = "All")))
>
> but I don't know how to remove one column as I guess this is not only a 
> matter of changing one attribute. I can get the mapping property with
>
> config.GetClassMapping(typeof(TimetableEntity)).ReferenceablePropertyIterator.First(a
>  
> => a.Name == "CurrentVersion");
>
> but I'm stuck here
>
> Regards
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to