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));
}