Skip to content

Instantly share code, notes, and snippets.

@mortezadalil
Created December 8, 2019 09:51
Show Gist options
  • Save mortezadalil/92c7d33259e7cea4d5127386e0ef4fa4 to your computer and use it in GitHub Desktop.
Save mortezadalil/92c7d33259e7cea4d5127386e0ef4fa4 to your computer and use it in GitHub Desktop.
using Cms.Core.IUseCases;
namespace Cms.Api.Presenters
{
public class PostApiPresenter<T> : IOutputPort<T>
{
public JsonContentResult ContentResult { get; }
public PostApiPresenter()
{
ContentResult = new JsonContentResult();
}
public void Handle(T response)
{
ContentResult.Content = ContentResult.Serialize(response);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment