public ConnectionDetails execute(UserIdentity request)
        {
            var cu = repository.Entities.Single(c => c.User.ID == request.user_id);

            return new ConnectionDetails()
            {
                connection_id = cu.ID,
                user_display_name = cu.User.DisplayName,
                user_status_message = cu.User.StatusMessage,
                long_lat_acc_geo_string = string.Format("{0},{1},{2}", cu.GeoLocation.Geoposition.Longitude, cu.GeoLocation.Geoposition.Latitude, cu.GeoLocation.AccuracyInMetres),
                user_id = cu.User.ID
            };
        }
Example #2
0
        public UserDetails execute(UserIdentity request)
        {
            Guard.IsNotNull(request, "request");
            var user = user_repository.Entities.SingleOrDefault(d => d.ID == request.user_id);

            if (user == null)
            {
                throw new Exception("User with this ID doesn't exist");
            }

            return new UserDetails
            {
                user_display_name = user.DisplayName,
                user_status_message = user.StatusMessage,
                user_id = user.ID
            };
        }