Αποτελέσματα Αναζήτησης
24 Ιαν 2013 · In your case, your objects should really be classes, which then in turn makes then reference types that you can consume. public class O { public string test { get; set; } } var newO = new O() { test = "cat" }; newO = "dog";
It says that it can't resolve it, and ReSharper just says it can be safely removed since it's not being used. ReSharper can recognize that it needs the reference and suggests that it "Reference MyLibrary and use MyFolder". I'm not sure why it's suggesting I add a reference I already have.
Everything in C# is associated with classes and objects, along with its attributes and methods. For example: in real life, a car is an object. The car has attributes, such as weight and color, and methods, such as drive and brake. A Class is like an object constructor, or a "blueprint" for creating objects.
7 Φεβ 2024 · Exceptions in C# provide a structured, uniform, and type-safe way of handling both system level and application-level error conditions. 21.2 Causes of exceptions. Exceptions can be thrown in two different ways. A throw statement throws an exception immediately and unconditionally.
14 Σεπ 2017 · C++/C# interop code can prove to be quite difficult to debug, especially across the boundary between managed and unmanaged code. The use of logging can mitigate this problem. PInvoke requires C-style linkage. Thus C++ classes need to be serialised before they are marshalled. PInvoke is not type safe. Errors are reported at runtime.
6 Φεβ 2013 · If the other class is compiled as a library (i.e. a dll) and this is how you want it, you should add a reference from visual studio, browse and point to to the dll file. If what you want is to incorporate the OtherClassFile.cs into your project, and the namespace is already identical, you can:
You need to create a object from your list like: List<CartProduct> lst = new List<CartProduct>(); CartProduct obj = lst.Find(x => (x.Name == "product name")); That object get the looked value searching by their properties: x.name. Then you can use List methods like Contains or Remove if (lst.Contains(obj)) { lst.Remove(obj); }