Browse files

Resolved minor issues 1, 2, and 3.

  • Loading branch information...
1 parent a0f10da commit 5a512f20043d42093127f5ea7df54d2c7f46e27d Billy McCafferty committed Jan 21, 2012
View
2 Example/MyStore/app/MyStore.Domain/Money.cs
@@ -10,7 +10,7 @@ public class Money
Amount = amount;
}
- public decimal Amount { get; set; }
+ public virtual decimal Amount { get; set; }
public override string ToString() {
return String.Format("{0:c}", Amount);
View
2 Example/MyStore/app/MyStore.Tests/MyStore.Tests.csproj
@@ -36,7 +36,7 @@
</Reference>
<Reference Include="nunit.framework, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\lib\nunit.framework.dll</HintPath>
+ <HintPath>..\..\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
View
BIN Example/MyStore/lib/SharpLite.Domain.dll
Binary file not shown.
View
BIN Example/MyStore/lib/SharpLite.NHibernateProvider.dll
Binary file not shown.
View
BIN Example/MyStore/lib/SharpLite.Web.dll
Binary file not shown.
View
34 README.txt
@@ -1,14 +1,24 @@
Welcome to S#arp Lite!
-Get started with your first S#arp Lite project...
+S#arp Lite is an architectural framework for the development of well-designed, custom-built, ASP.NET MVC applications.
+
+For an introduction, see http://devlicio.us/blogs/billy_mccafferty/archive/2011/11/11/s-arp-lite-the-basicss.aspx
+
+The code repository is found at https://github.com/codai/Sharp-Lite
+
+If you'd like to see a couple of example projects, take a look in the \Example folder.
+
+-----------------------------------
+
+To get started with your first S#arp Lite project...
#) Install Visual Studio 2010
#) Install ASP.NET MVC 3
#) Install Templify, available from https://github.com/endjin/Templify/downloads (Templify-v0.6.15144.msi was used with this release.)
-#) Copy \SharpLite\Template\s#arp-lite-project-v0.42.pkg to C:\Users\%USER%\AppData\Roaming\Endjin\Templify\repo\
+#) Copy \SharpLite\Template\s#arp-lite-project-v0.42.01.pkg to C:\Users\%USER%\AppData\Roaming\Endjin\Templify\repo\
(Note that the AppData folder is hidden by default.)
#) In Windows Explorer, create a new, empty folder for your S#arp Lite project (e.g., "MyNewProject")
@@ -33,26 +43,6 @@ Get started with your first S#arp Lite project...
Now, start building out your domain model and run the unit test CanGenerateDatabaseSchema to do just that...it'll be in the "Text Output" tab in NUnit. You can then run that SQL against your DB.
-------------------------------------------------------
-
-Get the example project up and running...
-
-#) Open \SharpLite\Example\MyStore\MyStore.sln
-
-#) Create a database called MyStore in SQL Server
-
-#) Update the connection string in:
- - MyStore.Web/Web.config
- - MyStore.Tests/App.config
-
-#) Run the unit-test generated SQL at \SharpLite\Example\MyStore\app\MyStore.DB\schema\UnitTestGeneratedSchema.sql against your DB
-
-#) Build the solution and run all the unit tests in MyStore.Tests...they should all pass
-
-#) F5
-
-
-
View
11 SharpLiteSrc/app/SharpLite.Domain/Validators/HasUniqueDomainSignatureAttribute.cs
@@ -10,14 +10,17 @@ namespace SharpLite.Domain.Validators
sealed public class HasUniqueDomainSignatureAttribute : ValidationAttribute
{
protected override ValidationResult IsValid(object value, ValidationContext validationContext) {
- IEntityWithTypedId<int> entityToValidate = validationContext.ObjectInstance as IEntityWithTypedId<int>;
+ if (value == null)
+ return null;
+
+ var entityToValidate = value as IEntityWithTypedId<int>;
if (entityToValidate == null)
throw new InvalidOperationException(
- "This validator must be used at the class level of an IEntityWithTypedId<int>. " +
- "The type you provided was " + validationContext.ObjectInstance.GetType());
+ "This validator must be used at the class level of an IEntityWithTypedId<int>. " +
+ "The type you provided was " + value.GetType());
- IEntityDuplicateChecker duplicateChecker = DependencyResolver.Current.GetService<IEntityDuplicateChecker>();
+ var duplicateChecker = DependencyResolver.Current.GetService<IEntityDuplicateChecker>();
if (duplicateChecker == null)
throw new TypeLoadException("IEntityDuplicateChecker has not been registered with IoC");
View
6 SharpLiteSrc/app/SharpLite.Web/Mvc/ModelBinder/EntityValueBinder.cs
@@ -17,7 +17,11 @@ internal class EntityValueBinder : SharpModelBinder
/// <param name = "bindingContext">The binding context.</param>
public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) {
Type modelType = bindingContext.ModelType;
- ValueProviderResult valueProviderResult = bindingContext.ValueProvider.GetValue(bindingContext.ModelName);
+
+ // Will look for the entity Id either named "ModelName" or "ModelName.Id"
+ ValueProviderResult valueProviderResult =
+ bindingContext.ValueProvider.GetValue(bindingContext.ModelName) ??
+ bindingContext.ValueProvider.GetValue(bindingContext.ModelName + ".Id");
if (valueProviderResult != null) {
Type entityInterfaceType =
View
BIN Template/TemplateSrc/lib/SharpLite.Domain.dll
Binary file not shown.
View
BIN Template/TemplateSrc/lib/SharpLite.Domain.pdb
Binary file not shown.
View
BIN Template/TemplateSrc/lib/SharpLite.NHibernateProvider.dll
Binary file not shown.
View
BIN Template/TemplateSrc/lib/SharpLite.NHibernateProvider.pdb
Binary file not shown.
View
BIN Template/TemplateSrc/lib/SharpLite.Web.dll
Binary file not shown.
View
BIN Template/TemplateSrc/lib/SharpLite.Web.pdb
Binary file not shown.
View
BIN Template/s#arp-lite-project-v0.42.pkg → Template/s#arp-lite-project-v0.42.01.pkg
Binary file not shown.
View
13 VersionHistory.txt
@@ -1,4 +1,17 @@
==================================================
+S#arp Lite 0.42.01
+==================================================
+
+Resolved the following issues:
+* https://github.com/codai/Sharp-Lite/pull/1
+* https://github.com/codai/Sharp-Lite/issues/2
+* https://github.com/codai/Sharp-Lite/issues/3
+
+Upgrading from previous version:
+
+#) Copy \SharpLite\Template\TemplateSrc\lib\SharpLite.* into your project's lib folder
+
+==================================================
S#arp Lite 0.42 for Visual Studio 2010
==================================================

0 comments on commit 5a512f2

Please sign in to comment.