Mercurial > altnet-hispano
view Agendas/trunk/src/Agendas.Blog/Impl/PostWriter.cs @ 100:cc91817a4206
Merge
author | jorge.rowies |
---|---|
date | Sat, 04 Jun 2011 22:46:06 -0300 |
parents | 3027c64344bd db4b1e2cae49 |
children | 1d820f17fc75 |
line wrap: on
line source
using System.Linq; using AltNetHispano.Agendas.Domain; namespace Agendas.Blog.Impl { public abstract class PostWriter : IPostWriter { private readonly IPostWriterWebService _postWriterWebService; protected PostWriter(IPostWriterWebService postWriterWebService) { _postWriterWebService = postWriterWebService; } public virtual void WritePost(Evento evento) { var title = GetTitle(evento); var body = GetBody(evento); this.ExecuteService(title, body, this.GetNombreUsuario(evento)); } protected abstract string GetBody(Evento evento); protected abstract string GetTitle(Evento evento); protected string GetNombreUsuario(Evento evento) { return evento.Tracks.Single(t => t.Accion == Accion.Publicar).Usuario.Nombre; } protected void ExecuteService(string title, string body, string author) { _postWriterWebService.WriteBlogPost(title, body, author, true); } } }