/// <summary> /// Creates a quick draft of an idea /// </summary> /// <param name="title">The name of the brilliant idea</param> /// <returns></returns> public ServiceResponse<Post> CreateQuickDraft(string title) { Func<Post> func = delegate { if (string.IsNullOrEmpty(title)) throw new ArgumentNullException("Idea can not be null or blank"); var entity = new Post() { Title = title }; return context.Save(entity); }; return this.Execute(func); }
public void CanCreateNewPosts() { var p = new Post(); p.Title = "New post"; p.Body = "I am always dancing in the moonlight"; }