Format:
Recent snippets matching tags of fluent
public static void Copy(string sourceDirName, string destDirName, bool excludeSubdirectories) { // Style #1: fluent Guard.MethodArgument("sourceDirName").IsNotNullOrEmpty(sourceDirName); Guard.MethodArgument("destDirName").IsNotNullOrEmpty(destDirName, "The destination directory is required!"); // Style #2: lambdas and expressions Guard.Argument.IsNotNullOrWhiteSpace(()=>sourceDirName); Guard.Argument.IsNotNullOrWhiteSpace(()=>destDirName, "The destination directory is required!");
310 Views
1 comments
public class Email : IHideObjectMembers { private SmtpClient _client; public MailMessage Message { get; set; } private Email() { Message = new MailMessage() { IsBodyHtml = true }; _client = new SmtpClient(); }
137 Views
no comments
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();
234 Views
no comments
.Mappings(m => {
m.FluentMappings.AddFromAssemblyOf<SomeMap>();
m.AutoMappings.AddFromAssemblyOf<SomeOtherMap>();
});
337 Views
no comments
Configuration config = Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2008.ConnectionString(
c => c.FromConnectionStringWithKey("ConnectionString"))
.Cache(c =>
c.UseQueryCache()
.QueryCacheFactory<StandardQueryCacheFactory>()
.ProviderClass<HashtableCacheProvider>()
.UseMinimalPuts()
)
.UseReflectionOptimizer()
228 Views
no comments
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) {
193 Views
no comments
private static ISessionFactory CreateSessionFactory() { return Fluently.Configure() .Database(MsSqlConfiguration.MsSql2008 .ConnectionString(c => c .FromConnectionStringWithKey("MyStore.Properties.Settings.StoreConnectionString")) ) .Mappings(m => m.FluentMappings .AddFromAssemblyOf<Program>())
223 Views
no comments
public static class ExtensionMethods { public static Configure FluentSagaPersister(this Configure config) { ISessionFactory sessionFactory = FluentConfig.GetFluentSessionFactory(); config.Configurer.RegisterSingleton<ISessionFactory>(sessionFactory); config.Configurer.ConfigureComponent<FluentSagaPersister>(ComponentCallModelEnum.Singlecall); return config; }
280 Views
no comments
public class FluentSagaPersister : ISagaPersister { /// <summary> /// Injected session factory. /// </summary> public ISessionFactory SessionFactory { get; set; } #region ISagaPersister Members public void Save(ISagaEntity saga)
313 Views
no comments
public class EnumConvention : IPropertyConvention, IPropertyConventionAcceptance { #region IPropertyConvention Members public void Apply(IPropertyInstance instance) { instance.CustomType(instance.Property.PropertyType); }
255 Views
no comments
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);
260 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
