Пример #1
0
        public ActionResult Vessels()
        {
            var model = new VesselViewModel();

            var vessels = new List <VesselViewModel>();

            var tempVessels = _vesselRepository.GetVessels().Where(x => x.IsActive).ToList();

            if (tempVessels != null && tempVessels.Count > 0)
            {
                foreach (var tempVessel in tempVessels)
                {
                    VesselViewModel convertedModel = new VesselConverter().ConvertToView(tempVessel);

                    vessels.Add(convertedModel);
                }
            }

            model.Vessels = vessels.OrderBy(x => x.VesselName).ToList();

            return(View(model));
        }