public void Handle(UserDeleted @event)
 {
     using (var context = new ProjectionContext(ConnectionString.Get()))
     {
         var entity = new UserSqlEntity()
         {
             Id = @event.AggregateId
         };
         context.Users.Attach(entity);
         context.Users.Remove(entity);
         context.SaveChanges();
     }
 }
        public void Handle(UserCreated @event)
        {
            using (var context = new ProjectionContext(ConnectionString.Get()))
            {
                var entity = context.Users.Find(@event.AggregateId);
                if (entity == null)
                {
                    entity = new UserSqlEntity();
                    context.Users.Add(entity);
                }

                entity.Id                = @event.AggregateId;
                entity.Login             = @event.Login;
                entity.Firstname         = @event.Firstname;
                entity.Lastname          = @event.Lastname;
                entity.IsEnabled         = true;
                entity.Email             = @event.Email;
                entity.EncryptedPassword = @event.EncryptedPassword;
                entity.Role              = @event.Role;
                entity.Signature         = @event.Signature;
                context.SaveChanges();
            }
        }