Skip to content

.Net library for dynamically creating adapter types

License

Notifications You must be signed in to change notification settings

PCOL/autoadapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

autoadapter

.Net library for dynamically creating adapter types

Installation

AutoAdapter is available on Nuget

Defining an Adapter

An adapter type is defined by creating an interface containing the methods, properties, and events that are required from the type being adapted. The adapter is then created by calling the CreateAdapter() method on the object being adapted. This is provided by an extension method on the object type.

Examples

public class AdaptedType
{
    public string Value { get; set; }

    public bool Method(string paremeter1, bool paraemeter2, int parameter3)
    {
        ...
    }
}

public interface AdapterType
{
    string Value { get; set; }
}

var adaptedType = new AdaptedType() { Value = "Hello World" };
var adpater = adaptedType.CreateAdapter<AdapterType>();

Console.WriteLine(adapter.Value);

About

.Net library for dynamically creating adapter types

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages