Make model type inherent to interface

This commit is contained in:
Matt Nadareski
2024-04-04 14:03:02 -04:00
parent d768172da1
commit 4b4c17ac24
2 changed files with 14 additions and 2 deletions

View File

@@ -1,11 +1,20 @@
namespace SabreTools.Serialization.Interfaces
{
public interface IWrapper
/// <summary>
/// Represents a wrapper around a top-level model
/// </summary>
/// <typeparam name="TModel">Top-level model for the wrapper</typeparam>
public interface IWrapper<TModel>
{
/// <summary>
/// Get a human-readable description of the wrapper
/// </summary>
string Description();
/// <summary>
/// Get the backing model
/// </summary>
TModel GetModel();
#if !NETFRAMEWORK
/// <summary>

View File

@@ -8,7 +8,7 @@ using SabreTools.Serialization.Interfaces;
namespace SabreTools.Serialization.Wrappers
{
public abstract class WrapperBase<T> : IWrapper
public abstract class WrapperBase<T> : IWrapper<T>
{
#region Descriptive Properties
@@ -24,6 +24,9 @@ namespace SabreTools.Serialization.Wrappers
#region Properties
/// <inheritdoc/>
public T GetModel() => Model;
/// <summary>
/// Internal model
/// </summary>