public ActionResult <IEnumerable <string> > PostAdmin(AdminsPost adminsPost) { if (!auth.CheckIfAdminPermissions(adminsPost)) { return(Unauthorized()); } var id = adminsPost.veranstalter; var result = model.PostAdmin(id); if (result) { var path = $"{HttpContext.Request.Scheme}://{HttpContext.Request.Host.Value}/admins/{id}"; return(Created(path, null)); } else { return(BadRequest()); } }
public int Compare(object a, object b) { AdminsPost x = a as AdminsPost; AdminsPost y = a as AdminsPost; bool areEqual = x.AdminsPostId == y.AdminsPostId && x.Subject == y.Subject && x.PostText == y.PostText && x.PostDate == y.PostDate && x.IsPersonal == y.IsPersonal && x.ToUserId == y.ToUserId; if (areEqual) { return(0); } else { return(1); } }
public void Add(AdminsPost post) { this.db.AdminsPost.Add(post); }