Revenj.DatabasePersistence.Postgres.QueryGeneration.QueryComposition.QueryParts.FromSqlSource C# (CSharp) Method

FromSqlSource() private static method

private static FromSqlSource ( string name, Type type ) : string
name string
type System.Type
return string
        private static string FromSqlSource(string name, Type type)
        {
            var source = SqlSourceAttribute.FindSource(type);

            if (!string.IsNullOrEmpty(source))
                return "{0} AS \"{1}\"".With(source, name);

            throw new NotSupportedException(@"Unknown sql source {0}!
            Add {1} attribute or {2} or {3} or {4} interface".With(
                type.FullName,
                typeof(SqlSourceAttribute).FullName,
                typeof(IAggregateRoot).FullName,
                typeof(IIdentifiable).FullName,
                typeof(IEntity).FullName));
        }