public bool Delete(MaterialType entity)
        {
            var materialType = _materialTypes.FirstOrDefault(e => e.ID == entity.ID);
            if (materialType == null) return false;

            _materialTypes.Remove(materialType);
            return true;
        }
        public MaterialType Insert(MaterialType entity)
        {
            if (GetById(entity.ID) != null) return null;

            var id = _materialTypes.Max(e => e.ID);
            var materialType = new MaterialType(id, entity.Name);
            _materialTypes.Add(materialType);

            return materialType;
        }
Exemplo n.º 3
0
 public bool Delete(MaterialType entity)
 {
     return _contextMaterialType.Delete(entity);
 }
Exemplo n.º 4
0
 public MaterialType Insert(MaterialType entity)
 {
     return _contextMaterialType.Insert(entity);
 }
Exemplo n.º 5
0
 public bool Update(MaterialType entity)
 {
     return _contextMaterialType.Update(entity);
 }