public void View(DateTime at, string fromIpAddress) { //Call extension method AddView, it will perform all parameters validation checks var view = this.AddView(at, fromIpAddress); //Add created view to StoryViews, this should increment views StoryViews.Add((StoryView)view); LastActivityAt = at; }
public virtual void View(DateTime at, string fromIPAddress) { Check.Argument.IsNotInvalidDate(at, "at"); Check.Argument.IsNotEmpty(fromIPAddress, "fromIPAddress"); StoryView view = new StoryView { StoryId = Id, IPAddress = fromIPAddress, Timestamp = at, }; StoryViews.Add(view); IoC.Resolve <IStoryViewRepository>().Add(view); LastActivityAt = at; }