Nézegettem az SQL 2008 könyvet, és az ottani példa alapján kedvem támadt kipróbálni a LINQ-t. Tetszik, nem tudom valódi appokban tényleg jó-e, de babrálni vele érdekes.
using System;
using System.Linq;
using Microsoft.SqlServer.Management.Dmf;
class Program
{
static void Main(string[] args)
{
ConsoleColor origColor = Console.ForegroundColor;
var fc = from f in PolicyStore.Facets
orderby f.DisplayName
select f;
foreach (var fi in fc)
{
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("Facet {0}:", fi.DisplayName);
Console.ForegroundColor = origColor;
var props = from f in fi.FacetProperties
orderby f.Name
select f;
int i = 0;
foreach (var pi in props)
{
Console.Write(pi.Name);
if (i++ > 0)
Console.Write(", ");
}
Console.WriteLine();
Console.WriteLine("-----------------------------------");
}
}
}
Állítólag ez a DMF nagy durranás az adminoknak, tessék örülni neki és olvasni az ingyenes fejezetet.
Could you hire me? Contact me if you like what I’ve done in this article and think I can create value for your company with my skills.
LEAVE A COMMENT
1 COMMENTS