コード例 #1
0
 public int UpdateUserType(DAL.Entity.UserType UserType)
 {
     try
     {
         _IUserTypeRepository.Update(UserType);
         return(_IUserTypeRepository.Save());
     }
     catch (Exception exception)
     {
         exception.Log();
         return(0);
     }
 }
コード例 #2
0
        public void Update_WasUserTypeUpdated_ActualEqualsExpectedData()
        {
            var expectedUserType = new UserType
            {
                ID          = 1,
                Description = "UpdatedUserType"
            };
            UserType actualUserType;

            using (var userTypeRepo = new UserTypeRepository(new brothershipEntities(ConnectionStrings.TEST_CONNECTION_STRING_NAME)))
            {
                userTypeRepo.Update(expectedUserType);
                actualUserType = userTypeRepo.GetById(expectedUserType.ID);
            }

            AssertUserTypesEqual(expectedUserType, actualUserType);
        }
コード例 #3
0
 public Response Put([FromBody] UserTypes value)
 {
     return(repo.Update(value));
 }