public SmcModel GetById(Guid id) { SmcModel smcModel = this._iogContext.SmcModels .Include(smcModelIterator => smcModelIterator.Manufacturer) .FirstOrDefault(smcModelIterator => smcModelIterator.Id == id && smcModelIterator.Active); return(smcModel); }
public SmcModel GetByName(string name) { SmcModel smcModel = this._iogContext.SmcModels .Include(smcModelIterator => smcModelIterator.Manufacturer) .Include(smcModelIterator => smcModelIterator.Smcs) .FirstOrDefault(smcModelIterator => smcModelIterator.Name == name && smcModelIterator.Active); if (smcModel != null) { smcModel.Smcs = smcModel.Smcs.Where(smc => smc.Active).ToList(); } return(smcModel); }
public SmcModel Update(SmcModel smcModel) { this._iogContext.Update(smcModel); this._iogContext.SaveChanges(); return(smcModel); }
public SmcModel Save(SmcModel smcModel) { this._iogContext.SmcModels.Add(smcModel); this._iogContext.SaveChanges(); return(smcModel); }