Revenj.DatabasePersistence.Postgres.PostgresObjectFactory.CustomizeName C# (CSharp) Method

CustomizeName() public method

public CustomizeName ( Type type, string property, string name ) : void
type System.Type
property string
name string
return void
        public void CustomizeName(Type type, string property, string name)
        {
            var pi = type.GetProperty(property);
            if (pi == null) throw new ArgumentException("Unable to find property {0} in type {1}.".With(property, type));
            CustomNames[pi] = name;
            foreach (var iface in type.GetInterfaces())
            {
                var ii = iface.GetProperty(property);
                if (ii == null) continue;
                //TODO: two interfaces can implement same name. can't really know which one it is
                CustomNames[ii] = name;
            }
        }