Skip to content

Commit 4e80836

Browse files
committed
Add v4.0.23 Release Notes
1 parent bd887cc commit 4e80836

File tree

1 file changed

+156
-0
lines changed

1 file changed

+156
-0
lines changed

release-notes.md

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,161 @@
11
# Release Notes
22

3+
## v4.0.23 Release Notes
4+
5+
## [AutoQuery](https://github.com/ServiceStack/ServiceStack/wiki/Auto-Query)
6+
7+
The big ticket feature in this release is the new [AutoQuery](https://github.com/ServiceStack/ServiceStack/wiki/Auto-Query) feature - with our approach of enabling Queryable Data Services, [not-like OData](https://github.com/ServiceStack/ServiceStack/wiki/Auto-Query#why-not-odata).
8+
9+
- Simple, intuitive and easy to use!
10+
- Works with all OrmLite's [supported RDBMS providers](https://github.com/ServiceStack/ServiceStack.OrmLite/#download)
11+
- Supports multiple table JOINs and custom responses
12+
- Code-first, declarative programming model
13+
- Promotes clean, intent-based self-describing API's
14+
- Highly extensible, implementations are completely overridable
15+
- Configurable Adhoc, Explicit and Implicit conventions
16+
- Allows preemptive client queries
17+
- New `GetLazy()` API in Service Clients allow transparently streaming of paged queries
18+
- Raw SqlFilters available if required
19+
20+
#### AutoQuery Services are normal ServiceStack Services
21+
22+
AutoQuery also benefits from just being normal ServiceStack Services where you can re-use existing knowledge in implementing, customizing, introspecting and consuming ServiceStack services, i.e:
23+
24+
- Utilizes the same customizable [Request Pipeline](https://github.com/ServiceStack/ServiceStack/wiki/Order-of-Operations)
25+
- AutoQuery services can be mapped to any [user-defined route](https://github.com/ServiceStack/ServiceStack/wiki/Routing)
26+
- Is available in all [registered formats](https://github.com/ServiceStack/ServiceStack/wiki/Formats)
27+
- The [CSV Format](https://github.com/ServiceStack/ServiceStack/wiki/ServiceStack-CSV-Format) especially shines in AutoQuery who's tabular result-set are perfect for CSV
28+
- Can be [consumed from typed Service Clients](https://github.com/ServiceStack/ServiceStack/wiki/Clients-overview) allowing an end-to-end API without code-gen in [PCL client platforms as well](https://github.com/ServiceStack/Hello)
29+
30+
### Getting Started
31+
32+
AutoQuery uses your Services existing OrmLite DB registration, the example below registers an InMemory Sqlite Provider:
33+
34+
```csharp
35+
container.Register<IDbConnectionFactory>(
36+
new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider));
37+
```
38+
39+
There are no additional dependencies, enabling AutoQuery is as easy as registering the AutoQueryFeature Plugin:
40+
41+
```csharp
42+
Plugins.Add(new AutoQueryFeature { MaxLimit = 100 });
43+
```
44+
45+
The configuration above limits all queries to a maximum of **100** results.
46+
47+
The minimum code to expose a Query Service for the `Rockstar` table under a user-defined Route is just:
48+
49+
```csharp
50+
[Route("/rockstars")]
51+
public class FindRockstars : QueryBase<Rockstar> {}
52+
```
53+
54+
With no additional code, this allows you to use any of the registered built-in conventions, e.g:
55+
56+
/rockstars?Ids=1,2,3
57+
/rockstars?AgeOlderThan=42
58+
/rockstars?AgeGreaterThanOrEqualTo=42
59+
/rockstars?FirstNameIn=Jim,Kurt
60+
/rockstars?FirstNameBetween=A,F
61+
/rockstars?FirstNameStartsWith=Jim
62+
/rockstars?LastNameEndsWith=son
63+
/rockstars?IdAbove=1000
64+
65+
You're also able to formalize your API by adding concrete properties to your Request DTO:
66+
67+
```csharp
68+
public class QueryRockstars : QueryBase<Rockstar>
69+
{
70+
public int? AgeOlderThan { get; set; }
71+
}
72+
```
73+
74+
Which now lets you access AutoQuery Services from the ServiceStack's [Typed Service Clients](https://github.com/ServiceStack/ServiceStack/wiki/C%23-client):
75+
76+
```csharp
77+
client.Get(new QueryRockstars { AgeOlderThan = 42 });
78+
```
79+
80+
You can also take advantage of the new `GetLazy()` API to transparently stream large result-sets in managable-sized chunks:
81+
82+
```csharp
83+
var results = client.GetLazy(new QueryMovies { Ratings = new[]{"G","PG-13"}}).ToList();
84+
```
85+
86+
As GetLazy returns a lazy `IEnumerable<T>` sequence it can be used within LINQ expressions:
87+
88+
```csharp
89+
var top250 = client.GetLazy(new QueryMovies { Ratings = new[]{ "G", "PG-13" } })
90+
.Take(250)
91+
.ConvertTo(x => x.Title);
92+
```
93+
94+
This is just a sampler, for a more complete guide to AutoQuery checkout the [AutoQuery wiki](https://github.com/ServiceStack/ServiceStack/wiki/Auto-Query).
95+
96+
## New VistaDB OrmLite Provider!
97+
98+
Also in this release is a preview release of OrmLite's new support for [VistaDB](http://www.gibraltarsoftware.com/) thanks to the efforts of [Ilya Lukyanov](https://github.com/ilyalukyanov).
99+
100+
[VistaDB](http://www.gibraltarsoftware.com/) is a commercial easy-to-deploy SQL Server-compatible embedded database for .NET that provides a good alternative to Sqlite for embedded scenarios.
101+
102+
To use first download and install [VistaDB](http://www.gibraltarsoftware.com/) itself, then grab OrmLite's VistaDB provider from NuGet:
103+
104+
PM> Install-Package ServiceStack.OrmLite.VistaDb
105+
106+
Then register the VistaDB Provider and the filename of what embedded database to use with:
107+
108+
```csharp
109+
VistaDbDialect.Provider.UseLibraryFromGac = true;
110+
111+
container.Register<IDbConnectionFactory>(
112+
new OrmLiteConnectionFactory("Data Source=db.vb5;", VistaDbDialect.Provider));
113+
```
114+
115+
The VistaDB provider is almost a complete OrmLite provider, the one major missing feature is OrmLite's new support for [Optimistic Concurrency](https://github.com/ServiceStack/ServiceStack.OrmLite/#optimistic-concurrency) which is missing in VistaDB which doesn't support normal Database triggers but we're still researching the most optimal way to implement this in VistaDB.
116+
117+
## Improved AspNetWindowsAuthProvider
118+
119+
A new `LoadUserAuthFilter` was added to allow `AspNetWindowsAuthProvider` to retrieve more detailed information about Windows Authenticated users by using the .NET's ActiveDirectory services, e.g:
120+
121+
```csharp
122+
public void LoadUserAuthInfo(AuthUserSession userSession,
123+
IAuthTokens tokens, Dictionary<string, string> authInfo)
124+
{
125+
if (userSession == null) return;
126+
using (PrincipalContext pc = new PrincipalContext(ContextType.Domain))
127+
{
128+
var user = UserPrincipal.FindByIdentity(pc, userSession.UserAuthName);
129+
tokens.DisplayName = user.DisplayName;
130+
tokens.Email = user.EmailAddress;
131+
tokens.FirstName = user.GivenName;
132+
tokens.LastName = user.Surname;
133+
tokens.FullName = (String.IsNullOrWhiteSpace(user.MiddleName))
134+
? "{0} {1}".Fmt(user.GivenName, user.Surname)
135+
: "{0} {1} {2}".Fmt(user.GivenName, user.MiddleName, user.Surname);
136+
tokens.PhoneNumber = user.VoiceTelephoneNumber;
137+
}
138+
}
139+
```
140+
141+
```csharp
142+
Plugins.Add(new AuthFeature(
143+
() => new CustomUserSession(),
144+
new IAuthProvider[] {
145+
new AspNetWindowsAuthProvider(this) {
146+
LoadUserAuthFilter = LoadUserAuthInfo
147+
}
148+
));
149+
```
150+
151+
Above example kindly provided by [Kevin Howard](https://github.com/KevinHoward).
152+
153+
## Other features
154+
155+
- [OrmLite's T4 Templates](https://github.com/ServiceStack/ServiceStack.OrmLite/#t4-template-support) were improved by [Darren Reid](https://github.com/Layoric)
156+
- ApiVersion added to Swaggers ResourcesResponse DTO
157+
- `Uri` in RedisClient allows passwords
158+
3159
# v4.0.22 Release Notes
4160

5161
## OrmLite

0 commit comments

Comments
 (0)