CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of fluent nhibernate
C#
public class ParentMap : ClassMap<Parent>
{
    public ParentMap()
    {
        Table("parent_def");      
        Id(x => x.Id,"parent_id");
        Map(x => x.UID, "parent_uid").CustomSqlType("varchar").Length(40);
        Map(x => x.DeletedAt ,"dte_deleted").Nullable();
        Map(x => x.ModifiedAt, "dte_modified").Nullable();
        Map(x => x.CreatedAt, "dte_created").Nullable();
by Mikael Henriksson   November 19, 2009 @ 5:42am
256 Views
no comments
 
C#
.Mappings(m => { 
                 m.FluentMappings.AddFromAssemblyOf<SomeMap>();
         m.AutoMappings.AddFromAssemblyOf<SomeOtherMap>();
            });
by Mikael Henriksson   November 12, 2009 @ 9:36am
376 Views
no comments
 
C#
Configuration config = Fluently.Configure()
    .Database(MsSqlConfiguration.MsSql2008.ConnectionString(
                  c => c.FromConnectionStringWithKey("ConnectionString"))
                  .Cache(c =>
                         c.UseQueryCache()
                             .QueryCacheFactory<StandardQueryCacheFactory>()
                             .ProviderClass<HashtableCacheProvider>()
                             .UseMinimalPuts()
                  )
                  .UseReflectionOptimizer()
by Mikael Henriksson   October 25, 2009 @ 2:45am
261 Views
no comments
 
C#
new PersistenceSpecification<Component>(session, new ComponentEqualityComparer())
 
public class ComponentEqualityComparer : IEqualityComparer
{
    #region IEqualityComparer Members
 
    public bool Equals(object x, object y)
    {
        if (x == null || y == null)
        {
by Mikael Henriksson   October 13, 2009 @ 3:15am
212 Views
no comments
 
C#
private static ISessionFactory CreateSessionFactory()
       {
           return Fluently.Configure()
               .Database(MsSqlConfiguration.MsSql2008
                   .ConnectionString(c => c
                        .FromConnectionStringWithKey("MyStore.Properties.Settings.StoreConnectionString"))
                        )
               .Mappings(m =>
                   m.FluentMappings
                       .AddFromAssemblyOf<Program>())
by Mikael Henriksson   October 07, 2009 @ 11:13pm
252 Views
no comments
 
C#
public class EnumConvention :
    IPropertyConvention, 
    IPropertyConventionAcceptance
{
    #region IPropertyConvention Members
 
    public void Apply(IPropertyInstance instance)
    {
        instance.CustomType(instance.Property.PropertyType);
    }
by Mikael Henriksson   September 20, 2009 @ 2:04am
280 Views
no comments
 
C#
public class ComponentPropertyConvention : IPropertyConvention, IPropertyConventionAcceptance
{
    public void Accept(IAcceptanceCriteria<IPropertyInspector> criteria)
    {
        criteria.Expect(x => x.EntityType.IsAny(typeof (IndividualInfo), typeof (CompanyInfo), typeof (Address)));
    }
 
    public void Apply(IPropertyInstance instance)
    {
        var name = string.Format("{0}_{1}", instance.EntityType.Name, instance.Property.Name);
by David R. Longnecker   August 19, 2009 @ 7:48pm
284 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate