- tenant info <tenantName> command...

--HG--
branch : dev
This commit is contained in:
Suha Can 2010-04-22 11:31:24 -07:00
parent fb87c02273
commit 45c2b3ec7e

View File

@ -1,4 +1,5 @@
using Orchard.Commands;
using System.Linq;
using Orchard.Commands;
using Orchard.Environment.Configuration;
using Orchard.MultiTenancy.Services;
@ -48,5 +49,24 @@ namespace Orchard.MultiTenancy.Commands {
DataPrefix = prefix
});
}
[CommandHelp("tenant info <tenantName>: Display settings for a tenant")]
[CommandName("tenant info")]
public void Info(string tenantName) {
ShellSettings tenant = _tenantService.GetTenants().Where(x => x.Name == tenantName).FirstOrDefault();
if (tenant == null) {
Context.Output.Write(T("Tenant: ") + tenantName + T(" was not found"));
}
else {
Context.Output.WriteLine(T("Tenant Settings:"));
Context.Output.WriteLine(T("---------------------------"));
Context.Output.WriteLine(T("Name: ") + tenant.Name);
Context.Output.WriteLine(T("Provider: ") + tenant.DataProvider);
Context.Output.WriteLine(T("ConnectionString: ") + tenant.DataConnectionString);
Context.Output.WriteLine(T("Prefix: ") + tenant.DataPrefix);
Context.Output.WriteLine(T("---------------------------"));
}
}
}
}