Esempio n. 1
0
        //GET DETAIL Unit
        public static UnitViewModel GetDetailUnitById(int paramUnitId)
        {
            UnitViewModel result = new UnitViewModel();

            using (var db = new MarkomApplicationDBEntities())
            {
                var res = db.spUnitDetailByID(paramUnitId);

                result = res.Select(c => new UnitViewModel
                {
                    id          = c.id,
                    code        = c.code,
                    name        = c.name,
                    description = c.description
                }).FirstOrDefault();
            }

            return(result);
        }