Lambda for Dummies….anyone, anyone? I think not

Let’s dissect your code sample: filenames.SelectMany(f => Assembly.LoadFrom(f).GetCustomAttributes(typeof(PluginClassAttribute), true) .Cast<PluginClassAttribute>() .Select(a => a.PluginType) ).ToList(); So, we start off with a string[] called filenames. We invoke the SelectMany extension method on the array, and then we invoke ToList on the result: filenames.SelectMany( … ).ToList(); SelectMany takes a delegate as parameter, in this case the delegate must … Read more

How to OpenWebConfiguration with physical path?

You will have to map the physicalPath to a virtualPath. Here is how you would do that. using System.Web.Configuration; //Reference the System.Web DLL (project needs to be using .Net 4.0 full, not client framework) public static Configuration OpenConfigFile(string configPath) { var configFile = new FileInfo(configPath); var vdm = new VirtualDirectoryMapping(configFile.DirectoryName, true, configFile.Name); var wcfm = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)