Skip to content
This repository has been archived by the owner. It is now read-only.
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

README.md

Coda

Coda provides a base set of extension methods, libraries and interfaces to implement in client applications. As a .NET Standard library, it works everywhere that you may wish to use it.

It used used by Cedita for assisting in the building of enterprise-level applications.

Getting Started

For the core framework, install via NuGet.

Install-Package Coda -pre

For Bulk SQL Helpers, install via NuGet. (Note that the Coda.Data.Sql up to version 0.2 targets the .NET Framework, and is re-targeted to .NET Standard 2.0 from 0.3)

Install-Package Coda.Data.Sql -pre

For the ASP.NET Core Tag Helpers and extensions, install via Nuget.

Install-Package Coda.WebCore -pre

Then, add the following to your _ViewImports.cshtml file:

@addTagHelper *, Coda.WebCore

Feature Focus

Repository Pattern

Whilst the Repository pattern can be frowned upon in some circles, it's still a useful abstraction to make available. Found within Coda.Data is IRepository<TData, TKey> which can be used to build your repositories on top of that will follow a common interface, with both synchronous and asynchronous methods.

Coda.Data.EntityFramework and Coda.Data.EntityFrameworkCore provide base repositories for EF and EF Core respectively. (At time of writing these libraries are not yet ported)

Display Attributes from Enums

When working with enums it's nice to be able to seamlessly read the DataAnnotations Display attribute.

public enum MyEnum
{
    [Display(Name = "Default Value")]
    DefaultValue
}
// ..
using Coda.Extensions;
// ..
MyEnum.DefaultValue.GetDisplayName(); // "Default Value"

String Extensions

Use more natural syntax for string operations such as:

using Coda.Extensions;
// ..
var myString = "Really long string to work with.";
myString.IsNullOrEmpty(); // false
myString.IsNullOrWhitespace(); // false
myString.MaxLength(12, "..."); // "Really lo..."

Easier Model Copying

Copying values from one instance to another is simplified with ValuesFrom<T> extensions.

using Coda.Extensions;
// ..
public class MyObject
{
   public string TestString { get; set; }
   public int TestInt { get; set; }
}
// ..
var baseObj = new MyObject { TestString = "Hello World", TestInt = 0 };
var dbObj = new MyObject { TestString = "Goodbye World", TestInt = 1 };
dbObj.ValuesFrom(baseObj, nameof(MyObject.TestString)); // { TestString = "Hello World", TestInt = 1 }
// or, for same result using exclusion:
dbObj.ValuesFrom(baseObj, isExclusionList: true, properties: nameof(MyObject.TestInt));

About

Coda Framework provides helpful extension methods, Bulk SQL helpers, and helpful Tag Helpers for ASP.NET Core.

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.