Example #1
0
        public async Task <int> AddMake(VehicleMake make)
        {
            if (db != null)
            {
                db.VehicleMakes.Add(make);
                await db.SaveChangesAsync();

                return(make.ID);
            }

            return(0);
        }
Example #2
0
        public async Task <int> UpdateMake(VehicleMake make)
        {
            if (db != null)
            {
                //Update that model
                //db.vehicleModels.Update(model);
                db.Entry(make).State = EntityState.Modified;

                //Commit the transaction
                await db.SaveChangesAsync();

                return(make.ID);
            }
            return(0);
        }