DotVVM 1.1 RC
Pre-release.NET Core support
DotVVM.Framework was splitted into several projects.
- DotVVM.Framework now contains almost everything except Hosting layer, so it is portable between Owin on old .NET, AspNetCore on old .NET and AspNetCore on .NET Core
- DotVVM.Framework.Hosting.OWIN contains hosting layer for OWIN, works only on old .NET Framework
- DotVVM.Framework.Hosting.AspNetCore contains hosting layer for AspNetCore.
Since the common core of Dotvvm framework is not dependent on hosting technology, we had to implement unifying interfaces above IOwinContext/HttpContext, IOwinRequest/HttpRequest and so on. These interfaces are implemented in each hosting layer package and should allow you to write components without referencing concrete hosting technology. We have tested it on our bootstrap wrappers and it worked without any source code change.
If you'd like to access raw IHttpContext
/HttpRequest
you can use GetOwinContext()
or GetAspNetCoreContext()
on IDotvvmRequestContext
to get to them.
ServiceLocator
is now considered deprecated, you should use the new AspNet Dependency Injection. However the GetService<T>()
still works as a wrapper over IServiceProvider
and in OWIN hosting you can also register services. On AspNetCore hosting you should call AddDotVVM()
in Startup.ConfigureSorvices
method, see the samples how to do that. On OWIN the UseDotVVM()
method takes Action<IDotvvmBuilder>
where you can register them.
Route constraints
#161
implemented all route constraints that are available in WebAPI as specified at http://www.asp.net/web-api/overview/web-api-routing-and-actions/attribute-routing-in-web-api-2#constraints. You can add your own in DotvvmConfiguration.
Bool properties without value
#191
You don't have to type <dot:Button IsSubmitButton="true" />
, <dot:Button IsSubmitButton />
is enough, the value true
is assigned implicitly.
@import
directive
It works like using
in C#, you can import namespace, namespace as alias and type as alias.
@import MyApp.Resources <-- namespace is imported
@import RS=MyApp.Resources <-- namespace is aliased as RS
@import Resources=MyApp.Resources.DetailPageResources <-- type is aliased as Resources
You can also import these globally in DotvvmConfiguration.Markup.ImportedNamespaces
.
All directives also support generic types with C# syntax:
@viewModel System.Collection.Generic.List<MyApp.ViewModels.SomeViewModel>
@resourceNamespace
and @resourceType
directives are now deprecated and will not work any more.
Set which wrapper tag can be rendered by control in markup
@wrapperTag span
directive sets the tag name (to span
in this case) and @noWrapperTag
directive suppresses rendering of the wrapper tag.
Property groups
You can map all attribute stating with specified prefix to an dictionary using property group. The Class-...
and Param-...
attributes works this way. you can have a look how we use the in the HtmlGenericControl
and RouteLink
controls.
Action Filters splited into interface
You can still use the ActionFilterAttribute
, the way how it works inside was changed, so you create filter only for ViewModel/Command/Request.
See #261
Mapping serialization options from code
So you don't have to mark the classes with attributes. Useful when you don't want to mess up your model or you don't have access to that code.
See #262
[Flags] enums in dothtml
You can set these properties in markup. The enum member names in the property value are separated by ,
or |
.
Breaking Changes
- methods on
ActionFilterAttribute
/ExceptionFilterAttribute
are async - property
RoleView.HideNonAuthenticatedUsers
renamed toHideForAnonymousUsers
New Controls
- ClaimView - Like RoleView but for claims, renders content only if claims match the specified conditions.
- EnvironmentView - The one for Environment