Beispiel #1
0
 public IActionResult Create([FromBody] Meeting meet)
 {
     if (ModelState.IsValid)
     {
         Guid obj = Guid.NewGuid();
         meet.Id = obj.ToString();
         Meeting added_meet = _dataAccessProvider.AddMeetingRecord(meet);
         return(Ok(new Responce {
             meeting = added_meet, message = "Meeting was successfully added"
         }));
     }
     return(BadRequest(ModelState));
 }
Beispiel #2
0
 public IActionResult Create([FromBody] Meeting meet)
 {
     if (ModelState.IsValid)
     {
         Guid obj = Guid.NewGuid();
         meet.MeetingId = obj.ToString();
         _dataAccessProvider.AddMeetingRecord(meet);
         var meetings        = _dataAccessProvider.GetRecords(new OwnerParameters()).ToList();
         var meetings_string = JsonConvert.SerializeObject(meetings);
         distributedCache.SetString("meetings", meetings_string);
         return(Ok(new MeetingResponce {
             obj = meet, message = "Created"
         }));
     }
     return(BadRequest(ModelState));
 }