Created
August 17, 2020 19:48
-
-
Save zHaytam/a74c5342116bea30f33f818464af6795 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public class BlogPost | |
{ | |
public int Id { get; set; } | |
public string Title { get; set; } | |
public string Description { get; set; } | |
public bool Disabled { get; set; } | |
public DateTime Created { get; set; } | |
} | |
public interface IBlogService | |
{ | |
void DisablePost(BlogPost post); | |
BlogPost GetPost(int id); | |
} | |
public class BlogService : IBlogService | |
{ | |
public BlogPost GetPost(int id) | |
{ | |
return new BlogPost | |
{ | |
Id = id, | |
Title = "Test", | |
Description = "Test", | |
Disabled = false, | |
Created = DateTime.UtcNow | |
}; | |
} | |
public void DisablePost(BlogPost post) | |
{ | |
post.Disabled = true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment