public void AddGivePrivateLessonsAnnouncement(GivePrivateLessonsAnnouncement announcement, string senderId) { announcement.Sender = _studentExchangeDataContext.Users.Find(senderId); announcement.IssueDate = DateTime.Now; announcement.Receivers = SetPrivateLessonsAnnouncementReceivers(senderId); _studentExchangeDataContext.Announcements.Add(announcement); _studentExchangeDataContext.SaveChanges(); }
public IHttpActionResult PostGive([FromBody] GivePrivateLessonsAnnouncement announcement) { _announcementService.AddGivePrivateLessonsAnnouncement(announcement, GetCurrentUserId()); return(Content(HttpStatusCode.NoContent, "")); }