public async Task <IHttpActionResult> DeleteGroup(int groupID, int requesterID) { var requester = await db.Users.FirstOrDefaultAsync(u => u.UserID == requesterID); if (requester == null) { return(NotFound()); } var group = await db.Groups.FirstOrDefaultAsync(g => g.GroupID == groupID); if (group == null) { return(NotFound()); } if (group.GroupType == GroupType.GROUP.ToString()) { await db.DeleteAGroup(groupID, requesterID); } else { await db.DeleteAConversation(groupID, requesterID); } return(Ok()); }