S
shapper
Hello,
I am deleting a record using linq:
public void DeleteById(Int32 id) {
}
I think I might try to get the record first. And if does no exist to
fire an exception. Correct?
What should be the type of the exception?
Or should I just use something like:
public void Delete(MyEntity entity) {
}
And before I call delete I should try to get it. Something like:
Album album = albumRepository.FindById(id);
if (album != null)
albumRepository.Delete(album);
Thanks,
Miguel
I am deleting a record using linq:
public void DeleteById(Int32 id) {
}
I think I might try to get the record first. And if does no exist to
fire an exception. Correct?
What should be the type of the exception?
Or should I just use something like:
public void Delete(MyEntity entity) {
}
And before I call delete I should try to get it. Something like:
Album album = albumRepository.FindById(id);
if (album != null)
albumRepository.Delete(album);
Thanks,
Miguel