Profile

Cover photo
Blaž Miheljak
Lives in Ljubljana
58 followers|57,492 views
AboutPostsPhotosVideos

Stream

 
What is the reason, that GlobalResponseFilters aren't run for Razor pages? Any alternatives to achieve the same? And would be nice to mention it in docs..
Thanks, Blaz
1
Demis Bellot's profile photo
 
The Razor ContentPages are executed directly and don't go through the normal Request pipeline. They'll get executed for Razor Views in /Views since they're executed with the result of a Service.

Only the PreRequestFilters runs everywhere, e.g. in non-ServiceStack services like Custom HttpHanders, Razor Content Pages, static files, etc.
Add a comment...

Blaž Miheljak

Discussion  - 
 
Demis, it looks like, there has been a slight version/compilation mixup on the nuget.
All packages (that I checked), looks like they have been compiled on 19.8, except for Api.Swagger, which looks like from 3.9., but all have version 4.0.31.
The problem arises, when using Swagger, I get:
Could not load type 'ServiceStack.Host.MetadataTypeExtensions' from assembly 'ServiceStack, Version=4.0.31.0, Culture=neutral, PublicKeyToken=null'.","StackTrace"

And if check the ServiceStack.dll (v 4.0.31) it really doesn't contain the mentioned class - it has been added to git on 31.8. only...
1
John Watson's profile photoDemis Bellot's profile photoBlaž Miheljak's profile photo
7 comments
 
oh, we just crossposted. Thanks for looking into it...
And yes, "looks like" was there because I couldn't believe, that what I'm seeing is possible :)
Add a comment...

Blaž Miheljak

Discussion  - 
 
Hi,

I'm loving the new Autoquery feature, but I have a problem with joins. I can't find a way to explicitly state a join expression to be used.  

As I see it, the only option is to use reference naming convetions, which I can't for legacy reasons.

I think, that the best solution would be to use Attributes for defining relations - there is already References attribute which I think should be used, before falling back to naming conventions...
1
Demis Bellot's profile photoBlaž Miheljak's profile photo
6 comments
 
This is great news!

Will test and report back...
Add a comment...

Blaž Miheljak

Shared publicly  - 
 
Bi kdo bil rad fotograf?
 ·  Translate
Earlier today my friend and fellow photographer posted a link to a craigslist ad from a woman in Seattle looking for a wedding photographer. The woman was upset because she thought that $3,000 for a w...
1
Add a comment...

Blaž Miheljak

Shared publicly  - 
 
Kaj bo torej, www ali appi? gol za www ravnokar....
 ·  Translate
1
Add a comment...

Blaž Miheljak

Shared publicly  - 
 
Hud izum že iz 70'ih ... Helidom!
 ·  Translate
1
Add a comment...
Have him in circles
58 people
Tadej Maligoj's profile photo
Aljoša Ocepek's profile photo
Tanja Mezga's profile photo
Janko Slana's profile photo
Katja K. Ošljak's profile photo
Maja Visinski Andrejc's profile photo
Ales Cokan's profile photo
Olje Direkt's profile photo
Gorazd Oman's profile photo
 
Hi,

I need to log validation errors, with complete request DTO.

I've setup ValidationFeature with ErrorResponseFilter in which I do the logging, which works just fine.
The problem is, that I can't find the way to get hold of the current IRequest in my ErrorResponseFilter.
I tried HttpContext.Current.ToRequest();, but this "recreates" the request, without resolving dto and of course with empty IRequest.Items (which I also need to get some info from previous filters).

Is there a way to get current IRequest instance? 

Thanks, Blaž
1
Mike Mertsock's profile photoBlaž Miheljak's profile photoDemis Bellot's profile photo
4 comments
 
Actually it looks like we already inject the current request context for validators that implement IRequiresRequest: https://github.com/ServiceStack/ServiceStack/blob/master/src/ServiceStack/Validation/ValidationFilters.cs#L15

This would be the preferred approach.
Add a comment...

Blaž Miheljak

Discussion  - 
 
I have a db field of short with values limited to 0,1,2, which I'd like to server in my api as "enum" of strings. eg (0:'NA', 1: 'male', 2:'female').

What'd be the best way to solve this?

I tried with enum, struct, class, with different type on dbpoco (short) and dto (string), with converting values in dbprovider... But I can't get it work completely. There is always one aspect (db reading/writing, serializing/deserializing, expression building, deserializing untyped conditions in AutoQuery etc), that fails.

Ideas appreciated.
1
Blaž Miheljak's profile photoDemis Bellot's profile photo
4 comments
 
If you want to convert to different values inside the ORM you will need to do the projection with Raw Sql (or a custom view), otherwise you should do the projection in code and map it to a DTO that contains the values you want.
Add a comment...

Blaž Miheljak

Discussion  - 
 
Hi Demis,

I'm having trouble compiling my project with SS4 against .net 4.0. It looks like, that NuGet package ServiceStack.Razor is only compiled for .net 4.5. Any reason for that or am I missing something?
1
Demis Bellot's profile photoBlaž Miheljak's profile photo
2 comments
 
Thanks for a quick and obvious answer.
Add a comment...

Blaž Miheljak

Shared publicly  - 
 
uspelo nam je pregnati geje in lezbijke iz Maribora. Minuta 34 in dalje. Naša javna RTVS!
1
Add a comment...

Blaž Miheljak

Shared publicly  - 
 
Vizualno novinarstvo!
 ·  Translate
Je bil dr. Peter Jambrek, nekdanji ustavni sodnik in minister za notranje zadeve, pomemben lastnik in ustanovitelj zasebnih slovenskih fakultet, dolgoletni predsednik Zbora za republiko, »politični boter Gregorja Viranta«, kot so po novem janšistični žargon povsem posvojili tudi na RTV Slovenija, res sodelavec Udbe? Takšen, ki je špecal svoje prijatelje? Stvar me ne bi zanimala, če ne bi včeraj v osrednjem RTV dnevniku videl skrajno, ampak res sk...
1
Add a comment...
People
Have him in circles
58 people
Tadej Maligoj's profile photo
Aljoša Ocepek's profile photo
Tanja Mezga's profile photo
Janko Slana's profile photo
Katja K. Ošljak's profile photo
Maja Visinski Andrejc's profile photo
Ales Cokan's profile photo
Olje Direkt's profile photo
Gorazd Oman's profile photo
Basic Information
Gender
Male
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Ljubljana
Links