public void AddNewTest() { var roomtype = new RoomType { RoomTypeName = "Demo Room Type" }; roomtype.Created(Guid.NewGuid()); _repository.Add(roomtype); Assert.True(_context.SaveChangesAsync().Result); }
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); }