Permalink
Browse files

More Razor tests/demos + changes

  • Loading branch information...
1 parent 61205d9 commit 91e32f21eea19f0a84d7eff6680350ae16ddf939 @mythz mythz committed Jul 23, 2012
Showing with 3,464 additions and 233 deletions.
  1. +1 −0 release/copy.bat
  2. +1 −1 src/ServiceStack.Common/Properties/AssemblyInfo.cs
  3. +29 −0 src/ServiceStack.Common/StringExtensions.cs
  4. +27 −0 src/ServiceStack.Interfaces/OrmLite/DbConnectionFactory.cs
  5. +10 −0 src/ServiceStack.Interfaces/OrmLite/IDbConnectionFactory.cs
  6. +1 −1 src/ServiceStack.Interfaces/Properties/AssemblyInfo.cs
  7. +2 −0 src/ServiceStack.Interfaces/ServiceStack.Interfaces.csproj
  8. +5 −4 src/ServiceStack.Razor/Compilation/CompilerServiceBase.cs
  9. +2,344 −0 src/ServiceStack.Razor/Dapper/SqlMapper.cs
  10. +10 −1 src/ServiceStack.Razor/RazorFormat.cs
  11. +5 −3 src/ServiceStack.Razor/RazorHandler.cs
  12. +6 −0 src/ServiceStack.Razor/ServiceStack.Razor.csproj
  13. +83 −1 src/ServiceStack.Razor/Templating/TemplateBase.cs
  14. +3 −69 src/ServiceStack.Razor/Templating/TemplateService.ServiceStack.cs
  15. +3 −36 src/ServiceStack.Razor/ViewPage.cs
  16. +129 −0 src/ServiceStack.Razor/ViewPageBase.cs
  17. +4 −37 src/ServiceStack.Razor/ViewPage`1.cs
  18. +0 −3 src/ServiceStack.ServiceInterface/RequiredPermissionAttribute.cs
  19. +1 −3 src/ServiceStack/Properties/AssemblyInfo.cs
  20. +2 −0 src/ServiceStack/WebHost.EndPoints/EndpointHostConfig.cs
  21. +1 −14 tests/ServiceStack.Auth.Tests/App.config
  22. +8 −1 tests/ServiceStack.Auth.Tests/CatchAll.cshtml
  23. +110 −1 tests/ServiceStack.Auth.Tests/RazorAppHost.cs
  24. +25 −1 tests/ServiceStack.Auth.Tests/ServiceStack.Auth.Tests.csproj
  25. +51 −0 tests/ServiceStack.Auth.Tests/Views/Rockstars.cshtml
  26. +204 −0 tests/ServiceStack.Auth.Tests/Views/Shared/HtmlReport.cshtml
  27. +9 −3 tests/ServiceStack.RazorHostTests/CatchAll.cshtml
  28. +98 −32 tests/ServiceStack.RazorHostTests/Global.asax.cs
  29. +18 −1 tests/ServiceStack.RazorHostTests/ServiceStack.RazorHostTests.csproj
  30. +51 −0 tests/ServiceStack.RazorHostTests/Views/Rockstars.cshtml
  31. +204 −0 tests/ServiceStack.RazorHostTests/Views/Shared/HtmlReport.cshtml
  32. +12 −4 tests/ServiceStack.RazorHostTests/Views/ViewThatUsesLayoutAndModel.cshtml
  33. +0 −14 tests/ServiceStack.RazorHostTests/Views/ViewThatUsesLayoutAndModel2.cshtml
  34. +7 −3 tests/ServiceStack.RazorHostTests/Web.config
View
@@ -1,4 +1,5 @@
COPY ..\NuGet\ServiceStack\lib\net35\* latest\ServiceStack
+COPY ..\NuGet\ServiceStack\lib\net40\* latest\ServiceStack
COPY ..\NuGet\ServiceStack.Common\lib\net35\* latest\ServiceStack
COPY ..\NuGet\ServiceStack.Mvc\lib\net4\* latest\ServiceStack
COPY ..\NuGet\ServiceStack.Plugins.ProtoBuf\lib\net35\* latest\ServiceStack
@@ -33,7 +33,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("3.8.5.0")]
+[assembly: AssemblyVersion("3.9.0.0")]
// CCB Custom
[assembly: ContractNamespace("http://schemas.servicestack.net/types",
@@ -157,6 +157,35 @@ public static bool IsUserType(this Type type)
&& !type.Namespace.StartsWith("System.")
&& type.Name.IndexOfAny(SystemTypeChars) == -1;
}
+
+ public static bool IsInt(this string text)
+ {
+ if (string.IsNullOrEmpty(text)) return false;
+ int ret;
+ return int.TryParse(text, out ret);
+ }
+
+ public static int ToInt(this string text)
+ {
+ return int.Parse(text);
+ }
+
+ public static int ToInt(this string text, int defaultValue)
+ {
+ int ret;
+ return int.TryParse(text, out ret) ? ret : defaultValue;
+ }
+
+ public static long ToInt64(this string text)
+ {
+ return long.Parse(text);
+ }
+
+ public static long ToInt64(this string text, long defaultValue)
+ {
+ long ret;
+ return long.TryParse(text, out ret) ? ret : defaultValue;
+ }
}
}
@@ -0,0 +1,27 @@
+using System;
+using System.Data;
+
+namespace ServiceStack.OrmLite
+{
+ public class DbConnectionFactory : IDbConnectionFactory
+ {
+ private readonly Func<IDbConnection> connectionFactoryFn;
+
+ public DbConnectionFactory(Func<IDbConnection> connectionFactoryFn)
+ {
+ this.connectionFactoryFn = connectionFactoryFn;
+ }
+
+ public IDbConnection OpenDbConnection()
+ {
+ var dbConn = CreateDbConnection();
+ dbConn.Open();
+ return dbConn;
+ }
+
+ public IDbConnection CreateDbConnection()
+ {
+ return connectionFactoryFn();
+ }
+ }
+}
@@ -0,0 +1,10 @@
+using System.Data;
+
+namespace ServiceStack.OrmLite
+{
+ public interface IDbConnectionFactory
+ {
+ IDbConnection OpenDbConnection();
+ IDbConnection CreateDbConnection();
+ }
+}
@@ -33,7 +33,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("3.8.5.0")]
+[assembly: AssemblyVersion("3.9.0.0")]
[assembly: ContractNamespace("http://schemas.servicestack.net/types",
ClrNamespace = "ServiceStack.ServiceInterface.ServiceModel")]
@@ -376,6 +376,8 @@
<Compile Include="Messaging\UnRetryableMessagingException.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="OrmLite\DbConnectionFactory.cs" />
+ <Compile Include="OrmLite\IDbConnectionFactory.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Redis\Generic\IRedisHash.Generic.cs">
<SubType>Code</SubType>
@@ -201,10 +201,11 @@ public CodeCompileUnit GetCodeCompileUnit(string className, string template, ISe
var type = result.GeneratedCode.Namespaces[0].Types[0];
if (modelType != null)
{
- //if (CompilerServices.IsAnonymousType(modelType))
- //{
- // type.CustomAttributes.Add(new CodeAttributeDeclaration(new CodeTypeReference(typeof(HasDynamicModelAttribute))));
- //}
+ if (CompilerServices.IsAnonymousType(modelType))
+ {
+ type.CustomAttributes.Add(new CodeAttributeDeclaration(
+ new CodeTypeReference(typeof(HasDynamicModelAttribute))));
+ }
}
GenerateConstructors(CompilerServices.GetConstructors(templateType), type);
Oops, something went wrong.

0 comments on commit 91e32f2

Please sign in to comment.