public void Insert(CountryModel param) { param.Id = Guid.NewGuid(); // generate new ID for the new record dbContext.Countries.InsertOnSubmit(MapModelToObject(param)); //add to ORM layer dbContext.SubmitChanges(); // commit to DB }
public void Insert(CategoryModel categoryModel) { categoryModel.Id = Guid.NewGuid(); // generate new ID for the new record dbContext.Categories.InsertOnSubmit(MapModelToObject(categoryModel)); //add to ORM layer dbContext.SubmitChanges(); // commit to DB }