C# Random
Sources: https://docs.microsoft.com/en-us/dotnet/api/system.random?view=net-5.0
Error Character ‘%’, hexadecimal value 0x25 is illegal in an XML name
Error: XML configuration file contains illegal characters in xml. Resolution: Escapes or unescapes an XML file removing traces of offending characters that could be wrongfully interpreted as markup. The following characters are reserved in XML and must be replaced with their corresponding XML entities: ‘ is replaced with ' “ is replaced with " & is replaced with & < is replaced... » read more
XML Escape
Escapes or unescapes an XML file removing traces of offending characters that could be wrongfully interpreted as markup. The following characters are reserved in XML and must be replaced with their corresponding XML entities: ‘ is replaced with ' “ is replaced with " & is replaced with & < is replaced with < > is replaced with > https://www.freeformatter.com/xml-escape.html
Consuming a WCF Host
WCF Endpoint http://localhost:57945/Service1.svc Use the following to generate a service reference in your Connected Services client application… http://localhost:57945/Service1.svc?singleWsdl After you have generated the service reference objects, you can call the service directly from within your client application. If you have more that one end points, you will need to specify which end point to use.
C# Data Contracts
A data contract is a formal agreement between a service and a client that abstractly describes the data to be exchanged. That is, to communicate, the client and the service do not have to share the same types, only the same data contracts. A data contract precisely defines, for each parameter or return type, what data... » read more
WinSCP C# Example
Note: If ppk is required by destination FTP site, make sure the ppk is loaded into Pageant first. Else authentication will fail when the .NET app tries to connect to the FTP site, even if “GiveUpSecurityAndAcceptAnySshHostKey = true” is set. Sources: https://winscp.net/eng/docs/library_examples
C# Hashtable Class
Represents a collection of key/value pairs that are organized based on the hash code of the key. Sources: https://docs.microsoft.com/en-us/dotnet/api/system.collections.hashtable?view=netframework-4.8
Entity Framework Set Timeout
Entity Framework Core 1.0: Entity Framework 6: Entity Framework 5: Entity Framework 4 and below: Example:
C# Partial Class
It is possible to split the definition of a class, a struct, an interface or a method over two or more source files. Each source file contains a section of the type or method definition, and all parts are combined when the application is compiled. Partial Classes There are several situations when splitting a class definition is desirable:... » read more