public IActionResult AddAsset(AssetCreateModel newAsset) { var statuses = _assets.GetStatuses(); Book asset = new Book(); asset.Title = newAsset.Title; asset.Status = _assets.GetStatuses().FirstOrDefault(s => s.Id == 6); asset.NumberOfCopies = newAsset.NumberOfCopies; asset.Location = _assets.GetBranches().FirstOrDefault(b => b.Id == newAsset.CurrentLocationId); asset.Year = newAsset.Year; asset.Author = newAsset.AuthorOrDirector; asset.Cost = newAsset.Cost; asset.ISBN = newAsset.ISBN; asset.DeweyIndex = newAsset.DeweyCallNumber; asset.ImageUrl = newAsset.ImageUrl; _assets.AddBook(asset); return(View("./SuccessAdd")); }