Ejemplo n.º 1
0
        public void AddNewTest()
        {
            var roomtype = new RoomType
            {
                RoomTypeName = "Demo Room Type"
            };

            roomtype.Created(Guid.NewGuid());

            _repository.Add(roomtype);
            Assert.True(_context.SaveChangesAsync().Result);
        }
Ejemplo n.º 2
0
        public RoomType Add(RoomType info)
        {
            RoomType addroom = new RoomType();

            try
            {
                if (info != null)
                {
                    addroom = _roomTypeRepository.Add(info);
                    _unitOfWork.Commit();
                }
            }
            catch (Exception ex)
            {
                string FunctionName = string.Format("AddRoomtype('{0}')", info);
                Common.Logs.LogCommon.WriteError(ex.ToString(), FunctionName);
                return(null);
            }
            return(addroom);
        }