Skip to content

Instantly share code, notes, and snippets.

@fabiomaulo
Created July 6, 2010 14:05
Show Gist options
  • Save fabiomaulo/465412 to your computer and use it in GitHub Desktop.
Save fabiomaulo/465412 to your computer and use it in GitHub Desktop.
public void DomainDefinition(ObjectRelationalMapper orm)
{
orm.TablePerClass(tablePerClassRootEntities);
orm.TablePerClassHierarchy(tablePerClassHierarchy);
orm.Exclude<HasActivities>();
orm.Exclude<HasActivitiesStructures>();
orm.Exclude<HasStructures>();
orm.Exclude<DailySold>();
orm.Exclude<HourlySold>();
orm.Poid<GeoName>(geoName => geoName.GeoNameId);
orm.Complex<Country>(country => country.PhoneCountryCode);
orm.Complex<IProductCategory>();
orm.Complex<IProductVat>();
orm.Complex<IProductBehavior>();
orm.Complex<IBoothPriceBehavior>();
orm.Component<Gps>();
orm.ManyToMany<Contact, Company>();
orm.ManyToMany<Company, CompanyCategory>();
orm.ManyToOne<Sold, IMarketable>();
orm.ManyToMany<Exhibitor, Company>();
orm.ManyToMany<Exhibitor, ExhibitorCategory>();
orm.ManyToOne<Exhibitor, Company>();
orm.ManyToMany<UsersGroup, IUserSecurity>();
orm.HeterogeneousAssociation<ShoppingCart>(sci => sci.CreatedBy);
orm.HeterogeneousAssociation<ShoppingCartItem>(sci => sci.Product);
orm.Cascade<Company, Contact>(Cascade.Persist);
orm.Cascade<Expo, Image>(Cascade.All);
orm.PersistentProperty<Sold>(sold => sold.Total);
orm.PersistentProperty<ShoppingCart>(sold => sold.Total);
orm.PersistentProperty<ShoppingCart>(sold => sold.Vat);
orm.PersistentProperty<InstantMessage>(instantMessage => instantMessage.MessagingType);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment