public async Task <ICollection <ItemDTO> > GetAll()
        {
            LibraryServiceHttpClient libraryClient = new LibraryServiceHttpClient(url, httpClient);
            ICollection <Item>       items         = await libraryClient.ItemsAllAsync();

            return(_mapper.Map <ICollection <ItemDTO> >(items));
        }
        public async Task <ICollection <UserDTO> > GetAllUsers()
        {
            LibraryServiceHttpClient libraryClient = new LibraryServiceHttpClient(url, httpClient);
            ICollection <User>       users         = await libraryClient.UsersAllAsync();

            return(_mapper.Map <ICollection <UserDTO> >(users));
        }
        public async Task <ICollection <RecordDTO> > GetAllRecords()
        {
            LibraryServiceHttpClient LibraryClient = new LibraryServiceHttpClient(url, httpClient);
            ICollection <Record>     records       = await LibraryClient.RecordsAllAsync();

            return(_mapper.Map <ICollection <RecordDTO> >(records));
        }
        public async Task <ItemDTO> AddNewItem(ItemType type, ItemStatus status, int owner)
        {
            Item newItem = new Item()
            {
                ItemType   = type,
                ItemStatus = status,
                OwnerId    = owner
            };

            LibraryServiceHttpClient LibraryClient = new LibraryServiceHttpClient(url, httpClient);
            await LibraryClient.ItemsAsync(newItem);

            return(_mapper.Map <ItemDTO>(newItem));
        }
        public async Task <UserDTO> AddNewUser(string email, string password, UserStatus userstatus, UserRole userrole)
        {
            User newUser = new User()
            {
                Email      = email,
                Password   = password,
                UserStatus = userstatus,
                UserRole   = userrole
            };

            LibraryServiceHttpClient libraryClient = new LibraryServiceHttpClient(url, httpClient);
            await libraryClient.UsersAsync(newUser);

            return(_mapper.Map <UserDTO>(newUser));
        }
        public async Task <RecordDTO> AddNewRecord(int itemid, int userid, RecordStatus recordstatus, DateTime datetime)
        {
            Record newRecord = new Record()
            {
                ItemId       = itemid,
                UserId       = userid,
                RecordStatus = recordstatus,
                DateTime     = datetime
            };

            LibraryServiceHttpClient LibraryClient = new LibraryServiceHttpClient(url, httpClient);
            await LibraryClient.RecordsAsync(newRecord);

            return(_mapper.Map <RecordDTO>(newRecord));
        }