Skip to content

Instantly share code, notes, and snippets.

View jfromaniello's full-sized avatar
😀
coding

José F. Romaniello jfromaniello

😀
coding
View GitHub Profile
using System;
using System.Linq;
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.Resolvers;
namespace CompositeWPFContrib.Composite.WindsorExtensions
{
public class LazyLoader : ILazyComponentLoader
{
private readonly string[] allowedAssembliesNames = new[]
Comment on http://msmvps.com/blogs/lopez/archive/2009/07/29/no-somos-vulcanos.aspx (We are not vulcans)
The mechanism of evolution works more than anything because the variability. In software, this is no different. The evolution is because many people do different things, and only some, holed out.
public string[] GetUserTemplates(int userId)
{
return Enumerable.Range(1, 10)
.Select(i =>
{
string template = string.Empty;
int templateLenght = 0;
driver.GetUserTmpStr(0, userId, i, ref template, ref templateLenght);
return template;
}).ToArray();
using System;
using System.Linq;
using Castle.Core;
using Castle.Core.Interceptor;
using Castle.MicroKernel;
using Castle.MicroKernel.Facilities;
using Castle.MicroKernel.Registration;
using Chinook.Domain.Base;
using GenWise.Data;
using System;
using CP2010.Domain;
using FluentNHibernate.Automapping;
using FluentNHibernate.Automapping.Alterations;
namespace CP2010.Data.Impl.Domain
{
public class GrupoMapping : IAutoMappingOverride<Grupo>
{
public void Override(AutoMapping<Grupo> mapping)
var fail = false;
var configuration = new Configuration().Configure();
configuration.Properties[Environment.ShowSql] = "false";
var sessionFactory = configuration.BuildSessionFactory();
using (var session = sessionFactory.OpenSession())
{
var allClassMetadata = session.SessionFactory.GetAllClassMetadata();
foreach (var entry in allClassMetadata)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using PostSharp.Aspects;
using PostSharp.Aspects.Advices;
using PostSharp.CodeModel;
using PostSharp.Extensibility;
namespace VanAOP.PostSharp._4to
{
//A way to map WellKnownInstaceType ( http://fabiomaulo.blogspot.com/2009/08/from-db-to-ram-wellknowinstancetype.html )
//artifact
public class WellKnownInstancePattern<TType, TWellKnownInstanceType>
: IPatternApplier<MemberInfo, IPropertyMapper>
where TWellKnownInstanceType : WellKnownInstanceType<TType>
where TType : class
{
public bool Match(MemberInfo subject)
//This is from nhibernate source code
public class MsSql2008Dialect : MsSql2005Dialect
{
// Methods
public MsSql2008Dialect()
{
base.RegisterColumnType(DbType.DateTime2, "DATETIME2");
base.RegisterColumnType(DbType.DateTimeOffset, "DATETIMEOFFSET");
base.RegisterColumnType(DbType.Date, "DATE");
using System.Linq;
using ConfOrm;
using ConfOrm.NH;
using NHibernate.Cfg.MappingSchema;
using NUnit.Framework;
using SharpTestsEx;
namespace ConfOrmTests.TestCase
{
public class Foo<T>