This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var orm = new ObjectRelationalMapper(); | |
MapDomain(orm); | |
var mapper = new Mapper(orm); | |
RegisterPatterns(mapper); | |
CustomizeMapper(mapper); | |
var nhconf = ConfigureSessionFactory(); | |
nhconf.AddDeserializedMapping(mapper.CompileMappingFor(GetDomainClasses()), "FullDomain"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var orm = new ObjectRelationalMapper(); | |
var mapper = new Mapper(orm); | |
var entities = new List<Type>(); | |
entities.AddRange(RunModuleMapping<GeneralsPatternsModuleMappings>(orm, mapper)); | |
entities.AddRange(RunModuleMapping<MembershipModuleMapping>(orm, mapper)); | |
entities.AddRange(RunModuleMapping<CrmModuleMapping>(orm, mapper)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ignore file for Visual Studio 2010 | |
# use glob syntax | |
syntax: glob | |
# Ignore Visual Studio 2010 files | |
*.obj | |
*.exe | |
*.pdb | |
*.user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Persist(TDataRow dataRow) | |
{ | |
var entity = Get(dataRow.PartitionKey, dataRow.RowKey); | |
if (entity != null) | |
{ | |
var eTag = tableContext.GetEntityDescriptor(entity).ETag; | |
tableContext.Detach(entity); | |
tableContext.AttachTo(entityTableName, dataRow, eTag); | |
tableContext.UpdateObject(dataRow); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class DateTimeExtensions | |
{ | |
public static DateTime RoundMilliseconds(this DateTime source) | |
{ | |
return source.AddTicks(-(source.Ticks % (TimeSpan.TicksPerMillisecond * 10L))); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// On the fly ResultTransformer | |
public IDictionary<string, int> GetTagsCloud(Country country) | |
{ | |
return Session.GetNamedQuery("TagsCloud").SetInt32("pCountry", country.Id) | |
.List<IList<object>>().ToDictionary(row => (string)row[0], row => (int) row[1]); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// config | |
<property name="current_session_context_class"> | |
uNhAddIns.SessionEasier.Contexts.ThreadLocalSessionContext, uNhAddIns | |
</property> | |
// class impl | |
public class PersistenceRequest: IDisposable | |
{ | |
private bool disposed; | |
private readonly ISessionFactory factory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace NHibernate.Test.NHSpecificTest.NH2230 | |
{ | |
[TestFixture] | |
public class Fixture : BugTestCase | |
{ | |
[Test] | |
public void CanCreacteRetrieveDeleteComponentsWithPrivateReferenceSetterToParent() | |
{ | |
var entity = new MyEntity(); | |
var component = new MyComponentWithParent(entity){Something = "A"}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CreatePhisicalMappings | |
{ | |
[Test, Explicit] | |
public void CreateXmlMappings() | |
{ | |
HbmMapping[] mappings = new ConfOrmInitializer().GetCompiledMappingsPerClass(); | |
WriteAllXmlMapping(mappings); | |
} | |
private static void WriteAllXmlMapping(IEnumerable<HbmMapping> mappings) |
OlderNewer