Free NuGet Components
-
For those who may be interested, particularly .NET developers, I have published three (free) components to NuGet that could be useful to you. Documentation (README.md) is included in the folder to which your NuGet package manager deploys it. JHelpers JLogger JDAC As requested, here are the descriptions of the NuGet packages. I will post the entire README.md files' content as replies to this post.
-
For those who may be interested, particularly .NET developers, I have published three (free) components to NuGet that could be useful to you. Documentation (README.md) is included in the folder to which your NuGet package manager deploys it. JHelpers JLogger JDAC As requested, here are the descriptions of the NuGet packages. I will post the entire README.md files' content as replies to this post.
-
I’ll do just that as soon as I get to my computer. However, the links take you to the NuGet page for the selected component, which has a description of what they do. Thanks for the feedback.
-
For those who may be interested, particularly .NET developers, I have published three (free) components to NuGet that could be useful to you. Documentation (README.md) is included in the folder to which your NuGet package manager deploys it. JHelpers JLogger JDAC As requested, here are the descriptions of the NuGet packages. I will post the entire README.md files' content as replies to this post.
JHelpers ======== JHelpers is a .NET Standard 2.0 library component that can be used with any .NET project, whether Core or Standard, on any supported OS to access SQL Server. It is a library of generally useful methods and functionality that can save a developer from writing code to accomplish these mundane tasks – or worse, have several versions of a method that does the same thing written in multiple places. JHelpers is used in my JDAC and JLogger NuGet packages for that very reason. ContextMgr ---------- ContextMgr is a thread-safe singleton that can be used to store data in a single place accessible from anywhere, and any thread, in the application. One typical use is to store settings and other runtime values so their sources (file, database, etc.) only have to be read once. Anything that can be defined as a unique String name and a value or reference type of any kind can be kept there. Values are added as a String key name (which must be unique) and any value or reference type, boxed as a dynamic type. ContextMgr has no initialization, and as a singleton, does not use “new” to be created. The actual instance is dynamically created on the first reference in the code. Code Example
Boolean retVal = false;
ContextMgr.Instance.ContextValues.Add("Computer Name", Environment.MachineName);
ContextMgr.Instance.ContextValues.Add("Startup Time", DateTime.Now);
IPAddress[] ips = Dns.GetHostAddresses("BubbaComputer");
ContextMgr.Instance.ContextValues.Add("IP Addresses", ips);
dynamic machineName = "";
retVal = ContextMgr.Instance.ContextValues.TryGetValue("Computer Name", out machineName);
dynamic startupTime = "";
retVal = ContextMgr.Instance.ContextValues.TryGetValue("Startup Time", out startupTime);
dynamic hostAddresses = null;
retVal = ContextMgr.Instance.ContextValues.TryGetValue("IP Addresses", out hostAddresses);In your application’s shutdown code, I recommend adding this line so the ContextMgr disposes of its resources without waiting on the .NET garbage collector.
ContextMgr.Instance.Dispose();
CommonHelpers ------------- This is a static class with a number of useful static methods. ### Extension Methods
String GetFullExceptionMessage(this Exception ex2Examine, Boolean getDataCollection, Boolean getStackTrace)
This Exception object extension returns error messages from the parent exception and any exceptions down the stack, and optionally, the data collection. The Exception.Data co
-
For those who may be interested, particularly .NET developers, I have published three (free) components to NuGet that could be useful to you. Documentation (README.md) is included in the folder to which your NuGet package manager deploys it. JHelpers JLogger JDAC As requested, here are the descriptions of the NuGet packages. I will post the entire README.md files' content as replies to this post.
JLogger ======= Overview -------- JLogger is a singleton component as a .NET Standard 2.0 library component that can be used with any .NET project, whether Core or Standard, on any supported OS to access SQL Server. JLogger has these characteristics: - Multithreaded use – As a singleton, it is accessible from any thread, and uses locking techniques to ensure there are no collisions. - High throughput – if the log is being used by many threads concurrently, the log writes do not stop the calling thread. JLogger uses a first-in, first-out (FIFO) queue where log writes are put in a queue and written to a file in a separate thread, concurrently in the background. The WriteDebugLog command takes the parameters, creates the log data, puts it in a queue. None of those steps are blocking. - Send an Email – A debug log write can optionally send an email (SMTP configuration data required) - Multiple Log Entry Types – there are several log entry types to choose from. What they each mean is up to the user writing the code. Some log types are reserved for the component, and would be ignored in processing the log entry. These are detailed below. - New Log File each Day – after midnight, a new log file is created so log files are named to show the date and time span the log was active. - Log Retention – logs are automatically removed after the specified number of days, unless zero is specified, in which case no log files are deleted. - Tab-delimited Log File – the log is written as a tab-delimited file. This enables opening up the file in programs like Excel for analysis. LOG_TYPE Enum ------------- The enum contains values for the types of logs, and for how the logs are created and managed. ### LOG_TYPE Values for Logging Unspecified - Used as a default value until an assignment is made. Flow – Used to denote a log entry that can be used to trace program flow in the log. Error – Used to denote serious exceptions that generally require follow-up and fixing. Informational – Denotes the log entry is for information only. Warning – Means the log entry is warning about a potentially serious condition. System – Log entry relates to system data. Performance – Log entry that usually shows elapsed time (as placed in the log message by the coder) and/or start time. Test – Used to indicate the log entry was intended for test results. SendEmail – Used in the WriteDebugLog LOG_TYPE variable
-
For those who may be interested, particularly .NET developers, I have published three (free) components to NuGet that could be useful to you. Documentation (README.md) is included in the folder to which your NuGet package manager deploys it. JHelpers JLogger JDAC As requested, here are the descriptions of the NuGet packages. I will post the entire README.md files' content as replies to this post.
JDAC Data Access Component ========================== JDAC is a .NET Standard 2.0 library component that can be used with any .NET project, whether Core or Standard, on any supported OS to access SQL Server. The library provides versatile and easy access to execute SQL queries or execute SQL with no returned dataset. There are also some built-in queries for schema information, and methods to convert System.Datat.DataTable objects to various uses. Details are provided below, along with code samples. Understanding the DBReturnValue object -------------------------------------- When executing a query of any kind, there is an opportunity to do more than just execute a query. There may be return parameters or a return code. If something goes wrong and an exception is thrown, it is often the case that there are multiple layers of exceptions that could be examined to troubleshoot the issue. DBReturnValue has several properties that address these issues and any System.Data.Dataset that is returned. The class is marked “[Serializable]”. ### Constructors
DBReturnValue()
– the default constructor for the class.
DBReturnValue(List sqlParams, Int32 retCode, String errorMessage)
Constructor for providing the SQL Parameters, the return code, and an error message, if any. This constructor is normally used internally. ### Properties
List
- (Get/Set) the parameters passed in, and after execution, the parameters are updated for any out parameters.
Int32 RetCode
– (Get/Set) the return code from a query execution. It can be the number of records affected, or a value representing status, depending on the type of SQL executed. If it is “execute no query” SQL, then RetCode is the number of records affected.
String ErrorMessage
– (Get/Set) an error message coming back from the SQL execution. If no exceptions, then it is an empty string.
System.Data.DataSet Data
– (Get/Set) for calls that return data, this is the dataset returned. ### Methods
Dispose()
– Called, usually in a Finally block, to dispose of any resources the object instance has. An internal flag ensures the internal Dispose process is called only once. There is also a finalizer method for the Garbage Collector to call. Understanding the JDataAccessSQL Object --------------------------------------- The JDataAccessSQL object is the workho
-
JHelpers ======== JHelpers is a .NET Standard 2.0 library component that can be used with any .NET project, whether Core or Standard, on any supported OS to access SQL Server. It is a library of generally useful methods and functionality that can save a developer from writing code to accomplish these mundane tasks – or worse, have several versions of a method that does the same thing written in multiple places. JHelpers is used in my JDAC and JLogger NuGet packages for that very reason. ContextMgr ---------- ContextMgr is a thread-safe singleton that can be used to store data in a single place accessible from anywhere, and any thread, in the application. One typical use is to store settings and other runtime values so their sources (file, database, etc.) only have to be read once. Anything that can be defined as a unique String name and a value or reference type of any kind can be kept there. Values are added as a String key name (which must be unique) and any value or reference type, boxed as a dynamic type. ContextMgr has no initialization, and as a singleton, does not use “new” to be created. The actual instance is dynamically created on the first reference in the code. Code Example
Boolean retVal = false;
ContextMgr.Instance.ContextValues.Add("Computer Name", Environment.MachineName);
ContextMgr.Instance.ContextValues.Add("Startup Time", DateTime.Now);
IPAddress[] ips = Dns.GetHostAddresses("BubbaComputer");
ContextMgr.Instance.ContextValues.Add("IP Addresses", ips);
dynamic machineName = "";
retVal = ContextMgr.Instance.ContextValues.TryGetValue("Computer Name", out machineName);
dynamic startupTime = "";
retVal = ContextMgr.Instance.ContextValues.TryGetValue("Startup Time", out startupTime);
dynamic hostAddresses = null;
retVal = ContextMgr.Instance.ContextValues.TryGetValue("IP Addresses", out hostAddresses);In your application’s shutdown code, I recommend adding this line so the ContextMgr disposes of its resources without waiting on the .NET garbage collector.
ContextMgr.Instance.Dispose();
CommonHelpers ------------- This is a static class with a number of useful static methods. ### Extension Methods
String GetFullExceptionMessage(this Exception ex2Examine, Boolean getDataCollection, Boolean getStackTrace)
This Exception object extension returns error messages from the parent exception and any exceptions down the stack, and optionally, the data collection. The Exception.Data co
-
These tools help us to add libraries in visual studio which makes work simpler for the developers. There are many more tools which can be used if you want to know about marketing tools then you can go to digital marketing tools in London.