V4 release preparation

175 views
Skip to first unread message

Shatl

unread,
Dec 1, 2016, 5:45:48 PM12/1/16
to S#arp Architecture
Hello guys,

Version 4 is coming soon :) 

Below is the draft release notes for V4. Pre-release packages available on NuGet, I'd love to hear your comments.

This release has lot of breaking changes: besides the code cleanup, it makes SharpArch more IoC- friendly. 


Breaking Changes

  • Target platform changed to .NET 4.5;
  • #124 removed Command/Query infrastructure - consider using MediatR instead;
  • Now uses C# 6.0 syntax;
  • NHibernateSession replaced with ISession constructor injection;
  • #145 Removed Design by Contract, TestSyntaxHelpers and CommonServiceLocator code and dependencies.

SharpArch.Web.Http.Castle

  • WindsorControllerExtensions renamed to WindsorHttpExtensions.
  • WindsorPropertyInjectionKernelExtensions replaced with internal SharpArch.Castle.Extensions.WindsorPropertyInjectionExtensions (shared with SharpArch.Web.Mvc).

SharpArch.Web.Mvc

  • WindsorExtensions renamed to WindsorMvcExtensions.
  • TransactionAttribute will commit Transaction in OnActionExecuted, not in OnResultExecuted(). Recommended approach to access database in Controller, not View.

SharpArch.Testing.NUnit

  • RepositoryTestsHelper refactored to TestDatabaseInitializer.

Fixes

  • #54 - NHibernate event listeners registered through XML gets removed.

New Features

  • ASP.NET MVC Filter property injection with Castle.
  • WebAPI Filter property injection (for singleton dependencies only).

Samples

  • Samples are now part of main repository;

Internal changes

  • Builds moved to AppVeyour;
  • Use GitVersion to maintain SemVer;

Raw list of issues closed

  • #137 - Perform dependency validation at property cache initialization stage
  • #124 - Remove Command processing code
  • #120 - WebAPI Windsor property injection for Action Filters +feature
  • #119 - MVC: Windsor property injection for Action Filters +feature
  • #117 - Move Sample apps to Sharp architecture repository
  • #115 - sharp-architecture via NuGet
  • #113 - Migrate dev branch to .NET 4.5
  • #96 - Restore nuget packages before starting build
  • #93 - Machine Spec tests failing
  • #88 - Remove the call to session.Flush from LinqRepositoryWithTypedId
  • #86 - CommandProcessor ignores handler with a TResult
  • #85 - Allow for NH Configuration to be manipulated before creating factory
  • #80 - Make the NHibernateRepositoryWithTypedId.Delete(TId id) method non-virtual
  • #79 - Transaction attributes to use ITransactionManager +feature
  • #61 - [NHibernate] Update Setup +feature
  • #54 - NHibernate event listeners registered through xml gets removed +fix
  • #52 - Add support for ASP.NET Web API +feature
  • #50 - Merge NHRepository and the NH LinqRepository classes
  • #49 - Remove SaveAndEvict from ILinqRepository

Henry Senior

unread,
Sep 11, 2017, 2:06:58 PM9/11/17
to S#arp Architecture
Hi I upgraded from v 3.01 to v 4.01. 

WebSessionStorage, NHibernateSession, NHibernateInitializer  don't appear to exist any more and I cant see what should replace them.

Any help much appreciated.

Henry

i...@seifattar.net

unread,
Sep 11, 2017, 7:29:04 PM9/11/17
to sharp-arc...@googlegroups.com
Hi,

They were moved out in favour of classes depending on ISession directly.

Here is some code that shows how the container and nhibernate are initialised now


If you were using NhibernateSession anywhere, then you would need to replace that with a dependency on ISession. Have a look at that sample solution and hopefully it'll help out.
--
You received this message because you are subscribed to the Google Groups "S#arp Architecture" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sharp-architect...@googlegroups.com.
To post to this group, send email to sharp-arc...@googlegroups.com.
Visit this group at https://groups.google.com/group/sharp-architecture.
For more options, visit https://groups.google.com/d/optout.

Henry Senior

unread,
Oct 19, 2017, 1:04:04 PM10/19/17
to sharp-arc...@googlegroups.com
thank you for this!

To unsubscribe from this group and stop receiving emails from it, send an email to sharp-architecture+unsub...@googlegroups.com.
To post to this group, send email to sharp-architecture@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "S#arp Architecture" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sharp-architecture/PLzpv_z72hE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sharp-architecture+unsub...@googlegroups.com.
To post to this group, send email to sharp-architecture@googlegroups.com.

Henry Senior

unread,
Jun 25, 2018, 11:57:56 AM6/25/18
to S#arp Architecture
Hi,

 I have finally started doing this upgrade.
I think everything is done except I'd like to have my Transaction attributes managed as a global filter.
When I try this I get the error:


if (TransactionManager == null)
                throw new InvalidOperationException(
                    "TransactionManager was null, make sure implementation of TransactionManager is registered in the IoC container.");


If I'm using the attribute to decorate a controller then no such problem. Is it possible to use TransactionAttribute as a global filter?
(Would I need a filterprovider?_


It's probably a bit late for comments as per your original request, but I had to change my repo code so that they were configured as PerWebRequest rather than Singleton, or they didn't get new ISession objects per request. It's obvious in hindsight but took me a while to figure it out.

Thanks in advance for any help,

Henry 

On Thursday, October 19, 2017 at 6:04:04 PM UTC+1, Henry Senior wrote:
thank you for this!

Shatl

unread,
Jul 8, 2018, 11:52:08 AM7/8/18
to S#arp Architecture
Hi Henry, 
Which .Net framework version are you using?

TransactionFilterAttribute requires NHibernate Session which is PerRequest.

I switched to .Net Core while ago, so cant recall how to inject per-request objects into global filters. You can try to do this with filter provider. 
Also, please note that global Transaction filter will cause new session to be opened for very request even if action does not need database interaction (not sure if it the case for your application)   
Hi,

thank you for this!



To post to this group, send email to sharp-arc...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "S#arp Architecture" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sharp-architecture/PLzpv_z72hE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sharp-architecture+unsub...@googlegroups.com.
To post to this group, send email to sharp-arc...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages