public void PostMessage(Message message, int? parentId) { if (!_data.IsEnrolledInGroup(message.User.UserId, message.GroupId)) throw new InvalidOperationException(string.Format("User {0} is not enrolled in group {1}", message.User.UserId, message.GroupId)); _data.InsertMessage(message, parentId); }
public ActionResult PostMessage(string text, int groupId, int? parentId = null) { var session = GetSession(); var message = new Message { GroupId = groupId, PostDate = DateTime.Now, User = new User { UserId = session.UserId }, Value = text }; Client.PostMessage(session, message, parentId); return new JsonResult { Data = "Ok", JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
public void PostMessage(Authentication auth, Message message, int? parentId) { using(var business = new SocialServiceBusiness()) { business.Authentication.AuthenticateUser(auth); business.Groups.PostMessage(message, parentId); } }
public void InsertMessage(Message message, int? parentId) { throw new NotImplementedException(); }