Created
January 30, 2019 15:16
-
-
Save evgomes/e3250e264841add70f7c8cae058259ac to your computer and use it in GitHub Desktop.
SaveCategoryResponse, from Supermarket API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Supermarket.API.Domain.Models; | |
namespace Supermarket.API.Domain.Services.Communication | |
{ | |
public class SaveCategoryResponse : BaseResponse | |
{ | |
public Category Category { get; private set; } | |
private SaveCategoryResponse(bool success, string message, Category category) : base(success, message) | |
{ | |
Category = category; | |
} | |
/// <summary> | |
/// Creates a success response. | |
/// </summary> | |
/// <param name="category">Saved category.</param> | |
/// <returns>Response.</returns> | |
public SaveCategoryResponse(Category category) : this(true, string.Empty, category) | |
{ } | |
/// <summary> | |
/// Creates am error response. | |
/// </summary> | |
/// <param name="message">Error message.</param> | |
/// <returns>Response.</returns> | |
public SaveCategoryResponse(string message) : this(false, message, null) | |
{ } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment