public IEnumerable <Chat> GetAll() { List <ChatDb> chats = (List <ChatDb>)chatDAO.GetAll(); List <Chat> chats_newType = new List <Chat>(); foreach (ChatDb chat in chats) { Chat chat_newType = mapper.Map(chat); chats_newType.Add(chat_newType); } return(chats_newType); }