How to shift this keeping the NH fonctionality? + Questions

Topics: Core, Customizing Orchard, Writing modules
Apr 4, 2014 at 6:19 PM
Edited Apr 4, 2014 at 8:33 PM
1) 1-N relations where NH takes care of filling the linked record in the part automatically as in

public class CustomerPartRecord : ContentPartRecord 
{
        public virtual PriceListPartRecord PriceList { get; set; }
}
 public class CustomerPart : ContentPart<CustomerPartRecord>, ITitleAspect
{
        public PriceListPartRecord PriceList
        {
            get { Record.PriceList; }
            set { Record.PriceList=value; }
        }
}

SchemaBuilder.CreateTable("CustomerPartRecord", t => t
                            .ContentPartRecord()
                            .Column<int>("PriceList_Id", c => c.Nullable())
                            );

            SchemaBuilder.CreateForeignKey("Customer_PriceList", "CustomerPartRecord", new[] { "PriceList_Id" }, "PriceListPartRecord", new[] { "Id" });
and if this case nothing is saved if we modify the PriceListPartRecord directly ????


2) Could we mix in a same part shifted and non shifted columns ?
3) How to retrieve/store a [flag] enum value

small VS regex

return Record.(.*);
by
return Retrieve(r => r.$1);


AND
Record.(.*)=.*value;
by
Store(r => r.$1, value);
Apr 6, 2014 at 12:26 PM
Edited Apr 6, 2014 at 12:27 PM
Ok...very few answers, everybody is busy migrating ?

To reduce the number of questions to the essential one: could we do partial 'Shift' on the parts where some records from external indexes are present ?

My code frequently uses this, it is quite the only interesting feature I found in NH :).

When we shift a part, we are loosing this feauture, is there any plan to keep it working ? (this should be strange, beacuase not relying on NH, if somebody succeed doing this, why should we keep NH))

Problem is that doing so, the xml saved will not contain the corresponding records, or may be should I save the record Id when present ?

Looking for a recommandation and strategy.
Developer
Apr 10, 2014 at 11:04 AM