public int Post([FromBody] Roles roles)
        {
            int SaveReturn = 0;

            try
            {
                if (ModelState.IsValid)
                {
                    RoleContext.Roles.Add(roles);
                    SaveReturn = RoleContext.SaveChanges();
                }
            }
            catch (Exception ex)
            {
            }
            return(SaveReturn);
        }
Example #2
0
        public int Post([FromBody] Users users)
        {
            int SaveReturn = 0;

            try
            {
                if (ModelState.IsValid)
                {
                    UserContext.Users.Add(users);
                    SaveReturn = UserContext.SaveChanges();
                }
            }
            catch (Exception ex)
            {
            }
            return(SaveReturn);
        }