s#arp-architecture

Castle.Windsor and HttpContextWrapper

时光毁灭记忆、已成空白 提交于 2019-12-30 12:17:51
问题 HttpContextWrapper and HttpContextBase, as explained here, were introduced to make HttpContext more mockable/testable. I'm trying to use it with S#arp Architecture, and hitting some problems. My MVC Controllers are set up to accept an HttpContextBase argument in the constructor, and during Application_Start, HttpContextBase is registered with Castle.Windor as follows: container.Register(Component.For<HttpContextBase>().UsingFactoryMethod( () => new HttpContextWrapper(HttpContext.Current)));

Castle.Windsor and HttpContextWrapper

早过忘川 提交于 2019-12-30 12:17:49
问题 HttpContextWrapper and HttpContextBase, as explained here, were introduced to make HttpContext more mockable/testable. I'm trying to use it with S#arp Architecture, and hitting some problems. My MVC Controllers are set up to accept an HttpContextBase argument in the constructor, and during Application_Start, HttpContextBase is registered with Castle.Windor as follows: container.Register(Component.For<HttpContextBase>().UsingFactoryMethod( () => new HttpContextWrapper(HttpContext.Current)));

ServiceLocator not initialized in Tests project

梦想与她 提交于 2019-12-24 10:03:04
问题 When attempting to write a test related to my new Tasks (MVC3, S#arp 2.0), I get this error when I try to run the test: MyProject.Tests.MyProject.Tasks.CategoryTasksTests.CanConfirmDeleteReadiness: SetUp : System.NullReferenceException : ServiceLocator has not been initialized; I was trying to retrieve SharpArch.NHibernate.ISessionFactoryKeyProvider ----> System.NullReferenceException : Object reference not set to an instance of an object. at SharpArch.Domain.SafeServiceLocator 1.GetService()

Db4o Mvc Application Architecture

馋奶兔 提交于 2019-12-24 01:49:57
问题 I am currently testing out Db4o for an asp.net MVC 2 application idea but there are a few things I'm not quite sure on the best way to proceed. I want my application to use guessable routes rather than Id's for referencing my entities but I also think I need Id's of some sort for update scenarios. so for example I want /country/usa instead of /country/1 I may want to change the key name though (not perhaps on a country but on other entities) so am thinking I need an Id to use as the reference

Would you use the S#arp Architecture in a new commercial project?

安稳与你 提交于 2019-12-20 09:32:09
问题 The S#arp Architecture seems really cool, but do you think it's still too new to make the commitment to it in an important new project? (Let's assume the project appears to be a good fit for it at first glance.) It all seems very good, I'm just concerned that the new project I'm working on is using all the newer technologies - WCF, ASP.NET MVC etc - and that if I add one more infant technology I'm going to end up with lots of problems and not enough technical skill or community support to

T4 for Sharp Architecture/Northwind Problem

。_饼干妹妹 提交于 2019-12-18 19:45:11
问题 I have just downloaded sharparchitecture/Northwind and i'm trying to get crud scaffolding to work. I have changed nothing except adding missing reference to this class library. I try to run ScaffoldingGeneratorCommand.tt and I hit following 3 errors. Error 1 Compiling transformation: Invalid token 'this' in class, struct, or interface member declaration file:BaseTemplate.tt Error 2 Compiling transformation: Class, struct, or interface method must have a return type file:BaseTemplate.tt Error

NHibernate Validation Localization with S#arp Architecture

二次信任 提交于 2019-12-12 18:55:46
问题 I'm trying to localize error messages from NHibernate.Validator. From what I have read, the messages should automaticaly be localized if I set the CurrentCulture/CurrentUICultule ; wich I tried without success. I'm using S#arp Architecture with the default configuration. As I said, the only thnig I changed is the CurrentCulture/CurrentUICultule. Do I have to create a custom message interpolator for nhibernate validator? 回答1: I have posted in my blog about creating a Custom Interpolator that

Overridable Methods In Constructors -Help to Fix

半城伤御伤魂 提交于 2019-12-11 09:03:37
问题 Im attempting to use fxCop on a C# Project as kind of basis for C# coding standards. The project Im using is called S#arp Architecture and is freely available here: S#Arp Arch Now if I run fxCop (most things have been fixed already) I need to fix the CA2214 fxcop error for overridable methods in contructors. At the moment a piece of violating code looks like this: public class Region : Entity, IHasAssignedId<int> { public Region(string description) { Check.Require(!string.IsNullOrEmpty

S#arp Architecture many-to-many mapping overrides not working

巧了我就是萌 提交于 2019-12-11 01:48:06
问题 I have tried pretty much everything to get M:M mappings working in S#arp Architecture. Unfortunately the Northwind example project does not have a M:M override. All worked fine in my project before converting to S#arp and its choice of Fluent NHibernate's Auto mapping. I like the auto-mapping, it's good, however the overrides do not seem to register. It all seems to work in memory and in tests, however when committing data to a database nothing gets inserted into my M:M reference table. If we

NHibernate + IIS7.5 throws “A session factory has already been configured with the key of nhibernate.current_session”

自闭症网瘾萝莉.ら 提交于 2019-12-10 23:17:32
问题 Using S#arp Architecture 2.3 RC , I am trying to publish two websites which use -mostly- the same codebase. The first of the applications I publish runs correctly, however, upon deploying and trying to run the second application, I get the following exception: Access to the path 'C:\Windows\TEMP\nhibernate.current_session--851346262.bin' is denied. When I refresh the window, I then get this exception: A session factory has already been configured with the key of nhibernate.current_session I