{"action":"created","issue":{"url":"https://api.github.com/repos/DuoMes/duo/issues/46","repository_url":"https://api.github.com/repos/DuoMes/duo","labels_url":"https://api.github.com/repos/DuoMes/duo/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/DuoMes/duo/issues/46/comments","events_url":"https://api.github.com/repos/DuoMes/duo/issues/46/events","html_url":"https://github.com/DuoMes/duo/issues/46","id":139351874,"number":46,"title":"Aggiunta proprietà Version sulle View","user":{"login":"mauroservienti","id":1325611,"avatar_url":"https://avatars.githubusercontent.com/u/1325611?v=3","gravatar_id":"","url":"https://api.github.com/users/mauroservienti","html_url":"https://github.com/mauroservienti","followers_url":"https://api.github.com/users/mauroservienti/followers","following_url":"https://api.github.com/users/mauroservienti/following{/other_user}","gists_url":"https://api.github.com/users/mauroservienti/gists{/gist_id}","starred_url":"https://api.github.com/users/mauroservienti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mauroservienti/subscriptions","organizations_url":"https://api.github.com/users/mauroservienti/orgs","repos_url":"https://api.github.com/users/mauroservienti/repos","events_url":"https://api.github.com/users/mauroservienti/events{/privacy}","received_events_url":"https://api.github.com/users/mauroservienti/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/DuoMes/duo/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"nazarenomanco","id":11135338,"avatar_url":"https://avatars.githubusercontent.com/u/11135338?v=3","gravatar_id":"","url":"https://api.github.com/users/nazarenomanco","html_url":"https://github.com/nazarenomanco","followers_url":"https://api.github.com/users/nazarenomanco/followers","following_url":"https://api.github.com/users/nazarenomanco/following{/other_user}","gists_url":"https://api.github.com/users/nazarenomanco/gists{/gist_id}","starred_url":"https://api.github.com/users/nazarenomanco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nazarenomanco/subscriptions","organizations_url":"https://api.github.com/users/nazarenomanco/orgs","repos_url":"https://api.github.com/users/nazarenomanco/repos","events_url":"https://api.github.com/users/nazarenomanco/events{/privacy}","received_events_url":"https://api.github.com/users/nazarenomanco/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2016-03-08T18:12:46Z","updated_at":"2016-03-10T10:53:02Z","closed_at":null,"body":"Quando creiamo delle viste, ad esempio `TrattamentoView` o `BobinaMadreView` è importante che queste viste abbiano anche una proprietà `Version` (int) che è presente su tutti gli aggregati. La proprietà `Version` deve poi essere rimandata insieme al comando e serve al `ICommandHandler<MyCommand>` per decidere cosa fare se nel frattempo l'aggregato è cambiato. Quello che vuoi poter fare è una cosa del tipo:\r\n\r\n```\r\npublic object Handle( ComandoCheFaQualcosaDiInteressante command )\r\n{\r\n   using( var session = Factory.OpenSession() )\r\n   {\r\n      var aggregate = session.GetById<AggregatoFigo>( command.Id );\r\n      if( aggregate.Version != command.Version )\r\n      {\r\n         //che si fa?\r\n      }\r\n   }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/DuoMes/duo/issues/comments/194789031","html_url":"https://github.com/DuoMes/duo/issues/46#issuecomment-194789031","issue_url":"https://api.github.com/repos/DuoMes/duo/issues/46","id":194789031,"user":{"login":"nazarenomanco","id":11135338,"avatar_url":"https://avatars.githubusercontent.com/u/11135338?v=3","gravatar_id":"","url":"https://api.github.com/users/nazarenomanco","html_url":"https://github.com/nazarenomanco","followers_url":"https://api.github.com/users/nazarenomanco/followers","following_url":"https://api.github.com/users/nazarenomanco/following{/other_user}","gists_url":"https://api.github.com/users/nazarenomanco/gists{/gist_id}","starred_url":"https://api.github.com/users/nazarenomanco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nazarenomanco/subscriptions","organizations_url":"https://api.github.com/users/nazarenomanco/orgs","repos_url":"https://api.github.com/users/nazarenomanco/repos","events_url":"https://api.github.com/users/nazarenomanco/events{/privacy}","received_events_url":"https://api.github.com/users/nazarenomanco/received_events","type":"User","site_admin":false},"created_at":"2016-03-10T10:53:01Z","updated_at":"2016-03-10T10:53:01Z","body":"In effetti per le tabelle \"flat\" come ora avrebbe un senso... ma la View in CQRS è altro. \r\nMi devo staccare dal \"vecchio mondo\" :smile: \r\nEseguo!\r\n"}}