|
|
@ -55,17 +55,7 @@ namespace NzbDrone.Core.Datastore
|
|
|
|
|
|
|
|
|
|
|
|
public TModel Get(int id)
|
|
|
|
public TModel Get(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
return _dataMapper.Query<TModel>().Single(c => c.Id == id);
|
|
|
|
{
|
|
|
|
|
|
|
|
var c = _dataMapper.Query<TModel>().FromTable(typeof(TModel).Name);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (ArgumentNullException e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new InvalidOperationException(e.Message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -161,7 +151,7 @@ namespace NzbDrone.Core.Datastore
|
|
|
|
throw new InvalidOperationException("Attempted to updated model without ID");
|
|
|
|
throw new InvalidOperationException("Attempted to updated model without ID");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// _database.UpdateOnly(model, onlyFields, m => m.Id == model.Id);
|
|
|
|
// _database.UpdateOnly(model, onlyFields, m => m.Id == model.Id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|