You searched for new guid
. We found 22
results in 0.305 seconds.
Guid.NewGuid is a method, and you're not calling that method from your VB code - you're calling the constructor accepting a string. You can call that same constructor in C#: // Using an array initializer for simplicity Guid[] test = { new... more
You want AsEnumerable() to force the ToString() call to be evaluated locally rather than as part of the EF query. For example: using (DBEntities de = new DBEntities()) { string[] roleset = de.MySQLView ... more
Well you could just use dictionary.Values().Select(x => new SelectedListItem { Text = x }) Just be aware that it may not be in a useful order: Dictionary<,> is inherently unordered (or rather, the order may change and... more
You're using a method group conversion to create the Func<long, long, bool> used for the comparerFunc parameter. Unfortunately, the C# 5 specification currently requires that to create a new delegate instance each time it's run. From... more
You're missing precedence, basically. It's easier to see what's going on when this is reduced to a minimal example: using System; public class Program { public static void Main() { string[] a = { "x", "y" }; ... more
I would avoid using the same method. You've got two different requirements: Build a collection of anonymous types for use in the UI Build a list of GUIDs for children of the given node ID (I'm assuming you only want direct children,... more
What you're describing are generic constraints. Where T:New() == the generic parameter must be a class + have a default empty constructor No, that just says "the type argument must have a parameterless constructor". That actually... more
I'd use LINQ to XML to start with. Something like this: var doc = XDocument.Load(...); var themeName = doc.Root.Element("themename").Value; Guid themeGuid = Guid.NewGuid(); foreach (var element in... more
You're asking to assign a sequence value to single entity variable. That's like trying to do this: // Won't work for the same reason string name = new List<string> { "foo", "bar" }; If you're just trying to find out whether there... more
Unless GetPreviousCacheEntry could have problematic side-effects, it seems to me that you don't need method A at all. Just call method B and ignore the return value if you're not interested in it. As noted in comments, the methods aren't... more