public static List <CopyViewModel> CopiesParser(List <Copy> copies) { List <CopyViewModel> copyList = new List <CopyViewModel>(); foreach (var copy in copies) { CopyViewModel copyVM = new CopyViewModel(); copyVM.Status = new StatusViewModel(); copyVM.Location = new LocationViewModel(); copyVM.Book = new BookViewModel(); copyVM.CopyId = copy.CopyId; copyVM.RFID = copy.RFID; copyVM.Status.StatusId = copy.Status.StatusId; copyVM.Status.Name = copy.Status.Name; copyVM.Location.LocationId = copy.Location.LocationId; copyVM.Location.Shelf = copy.Location.Shelf; copyVM.Location.ShelfRow = copy.Location.ShelfRow; copyVM.Location.ShelfCol = copy.Location.ShelfCol; copyVM.Book.BookId = copy.Book.BookId; copyVM.Book.ImagePath = copy.Book.ImagePath; copyList.Add(copyVM); } return(copyList); }
public async Task <ActionResult> Index() { var model = new CopyViewModel { CopyList = await _copyService.GetAsync() }; return(View(model)); }
public ActionResult Index() { var model = new CopyViewModel() { CopyList = _copyService.Get() }; return(View(model)); }
public CopyWindow() { InitializeComponent(); DataContext = new CopyViewModel(); this.Closing += CopyWindow_Closing; }