CodedThought.Core.Data.PostGreSQL 1.0.0-alpha-7

This is a prerelease version of CodedThought.Core.Data.PostGreSQL.
dotnet add package CodedThought.Core.Data.PostGreSQL --version 1.0.0-alpha-7                
NuGet\Install-Package CodedThought.Core.Data.PostGreSQL -Version 1.0.0-alpha-7                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CodedThought.Core.Data.PostGreSQL" Version="1.0.0-alpha-7" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CodedThought.Core.Data.PostGreSQL --version 1.0.0-alpha-7                
#r "nuget: CodedThought.Core.Data.PostGreSQL, 1.0.0-alpha-7"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CodedThought.Core.Data.PostGreSQL as a Cake Addin
#addin nuget:?package=CodedThought.Core.Data.PostGreSQL&version=1.0.0-alpha-7&prerelease

// Install CodedThought.Core.Data.PostGreSQL as a Cake Tool
#tool nuget:?package=CodedThought.Core.Data.PostGreSQL&version=1.0.0-alpha-7&prerelease                

CodedThought.Core.Data.PostGreSQL

A .NET Core Data Entity Provider for PostGreSQL Server.

Requirements

PostGreSQL requires Npgsql, CodedThough.Core.Configuration, and CodedThought.Core. These can be found in NuGet. - CodedThought.Core.Configuration - CodedThought.Core - Npgsql

Usage

  1. Install required packages. See requirements above.
  2. Add the Database Connection settings in the appSettings.json or a custom .json file.

    Note: See CodedThought.Core.Configuration for JSON configuration specifications.

  3. Add a new class and inherit from CodedThough.Core.Data.GenericDataStoreController. Below is a sample class file.
    using CodedThought.Core;
    using CodedThought.Core.Data;
    public class DataController : GenericDataStoreController {

		public DataController(IMemoryCache cache, CodedThought.Core.Configuration.ConnectionSetting connectionSetting) {
			DataStore = new GenericDataStore(cache, connectionSetting, "public");
		}

		public Person GetPerson(string email)
		{
			try
			{
				ParameterCollection param = DataStore.CreateParameterCollection();
				param.AddStringParameter("EmailAddress", email);
				return DataStore.Get<Person>(param);
			} catch (Exception) {
				throw;
			}
		}
		public List<Person> GetPeople() {
			try {
				return DataStore.GetMultiple<Person>(null);
			} catch {
				throw;
			}
		}
    }
    using System.Data;
    using CodedThought.Core;
    using CodedThought.Core.Data;
	///<summary>
	/// Person class used by the framework to locate the right table and columns with class and proprety annotations.
	///</summary>
	[DataTable("tblPeople")]
	public class Person
	{
		public Person() { }

		[DataColumn("EmailAddress", DbType.String, DataColumnOptions.PrimaryKey)]
		public string EmailAddress { get; set; }
		[DataColumn("FirstName", DbType.String)]
		public string FirstName { get; set; }
		[DataColumn("LastName", DbType.String)]
		public string LastName { get; set; }
	}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0-alpha-7 43 12/11/2024
1.0.0-alpha-6 46 11/6/2024
1.0.0-alpha-5 64 5/31/2024
1.0.0-alpha-4 70 5/22/2024