{"action":"opened","issue":{"url":"https://api.github.com/repos/MassTransit/MassTransit/issues/268","labels_url":"https://api.github.com/repos/MassTransit/MassTransit/issues/268/labels{/name}","comments_url":"https://api.github.com/repos/MassTransit/MassTransit/issues/268/comments","events_url":"https://api.github.com/repos/MassTransit/MassTransit/issues/268/events","html_url":"https://github.com/MassTransit/MassTransit/issues/268","id":57386896,"number":268,"title":"MT3 - Refactor saga repository into a simple store and storage process","user":{"login":"petedavis","id":164331,"avatar_url":"https://avatars.githubusercontent.com/u/164331?v=3","gravatar_id":"","url":"https://api.github.com/users/petedavis","html_url":"https://github.com/petedavis","followers_url":"https://api.github.com/users/petedavis/followers","following_url":"https://api.github.com/users/petedavis/following{/other_user}","gists_url":"https://api.github.com/users/petedavis/gists{/gist_id}","starred_url":"https://api.github.com/users/petedavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petedavis/subscriptions","organizations_url":"https://api.github.com/users/petedavis/orgs","repos_url":"https://api.github.com/users/petedavis/repos","events_url":"https://api.github.com/users/petedavis/events{/privacy}","received_events_url":"https://api.github.com/users/petedavis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-11T22:22:44Z","updated_at":"2015-02-11T22:22:44Z","closed_at":null,"body":"This is more of a suggestion, but I was looking at the ISagaRespository interface to see what is needed to implement for a particular storage engine, and there is a lot of logic in the repository implementation.\r\n\r\nWould it not be better to separate the send logic into a class that encapsulates the saga storage process, that then calls the repository for just the Save, Update, Delete and Get operations? Then the storage implementation would be much simpler.\r\n\r\nI don't have my head around the code bases at all, but just thinking that a possible separation could do something like:\r\n```\r\nIStorageProcess process = Activator.CreateInstance(typeof(SagaStorageProcess<>).MakeGenericType(sagaInstanceType));\r\n\r\n// Share the container repository instance through the process\r\nprocess.Send(context, next, repository);\r\n```\r\nBut to do this, the generic interfaces will also need non generic base interface to pass them into the send method. But then being a SagaStorageProcess<T>, it can then cast them back to ISagaRepository<T>, and throw an exception if not the correct generic type."}}