Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Only exception handling in controller?

$
0
0

This is probably a question that has been done many times, but i find myself doing this some times:

I wonder if it is right to double exception handling where if I create a post in a database from the controller:

try
{
   _postRepository.Create(post);
}
catch (Exception)
{
    throw;
}

But then when I wrote the repository I also wrote an exception handling there. But whose responisbility is this(controller or repository), or should I actually write it both places?


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>