Beispiel #1
0
        // POST: api/M_Roles
        public Responses Post([FromBody] M_RoleViewModel entity)
        {
            entity.Code = M_RoleRepo.GetNewCode();
            Responses result = new Responses();

            if (ModelState.IsValid)
            {
                result = M_RoleRepo.Update(entity);
            }
            else
            {
                result.Success = false;
            }
            return(result);
        }
Beispiel #2
0
 // PUT: api/M_Roles/5
 public Responses Put(int id, [FromBody] M_RoleViewModel entity)
 {
     entity.Id = id;
     return(M_RoleRepo.Update(entity));
 }