public void AddParamType(CustomParamTypeViewModel model) { CustomParamType custom = new CustomParamType { Description = model.Description, IsActive = true }; ContextPerRequest.CurrentData.CustomParamTypes.Add(custom); ContextPerRequest.CurrentData.SaveChanges(); }
public void EditParamType(CustomParamTypeViewModel model) { var data = (from param in ContextPerRequest.CurrentData.CustomParamTypes where param.CustomParamTypeID == model.CustomParamTypeID select param).FirstOrDefault(); if (data != null) { data.Description = model.Description; ContextPerRequest.CurrentData.SaveChanges(); } }