Skip to content

Instantly share code, notes, and snippets.

@zHaytam
Created August 17, 2020 19:48
Show Gist options
  • Save zHaytam/a74c5342116bea30f33f818464af6795 to your computer and use it in GitHub Desktop.
Save zHaytam/a74c5342116bea30f33f818464af6795 to your computer and use it in GitHub Desktop.
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