public CarModelTypeVo insert(CarModelTypeVo input)
        {
            using (var db = new MainDb())
            {

                db.carModelTypes.Add(input);
                db.SaveChanges();

                return input;
            }
        }
        public CarModelTypeVo update(CarModelTypeVo input, int? carModelTypeId= null)
        {
            using (var db = new MainDb())
            {

                if (carModelTypeId == null)
                    carModelTypeId = input.carModelTypeId;

                var res = db.carModelTypes.FirstOrDefault(e => e.carModelTypeId == carModelTypeId);

                if (res == null) return null;

                input.created = res.created;
               // input.createdBy = res.createdBy;
                db.Entry(res).CurrentValues.SetValues(input);

                db.SaveChanges();
                return res;

            }
        }